// 文件上传模块
// 秒寻科技
// zt 2024-11-07

package uploadfilerouter

import (
	"ipsomc/core/gin/midware/endecrypt"
	"ipsomc/core/gin/midware/islogin"
	"ipsomc/module/uploadfile/uploadfilehander"

	"github.com/gin-gonic/gin"
)

// 配置项目路由
func SetRouter(r *gin.RouterGroup) {
	groupRouter := r.Group("/uploadfile") //路由分组
	groupHand := uploadfilehander.UploadFileHan{}

	//上传升级文件
	groupRouter.POST("/uploadUpgradeFile", groupHand.UploadUpgradeFileHan)
	groupRouter.GET("/createWebSocket", groupHand.CreateWebSocketHan)

	//请求参数解密
	groupRouter.Use(endecrypt.DecryptReqParam())
	groupRouter.Use(islogin.PcIsLogin()) //判断是否登录

	//获得升级状态
	groupRouter.POST("/getUpgradeStatus", groupHand.GetUpgradeStatusHan)

}
