// 路由注册-基站参数
// 秒寻科技
// zt 2024-02-16

package bparamrouter

import (
	"ipsomc/core/gin/midware/endecrypt"
	"ipsomc/core/gin/midware/islogin"
	"ipsomc/module/bparam/bparamhandler"

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

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

	groupRouter.POST("/guiUploadBtsBaseParamAdd", groupHand.GuiUploadBtsBaseParamAddHan)
	groupRouter.POST("/guiUploadBtsBaseParamUpdate", groupHand.GuiUploadBtsBaseParamUpdateHan)

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

	//基站参数接口
	groupRouter.POST("/addBtsBaseParam", groupHand.AddBtsBaseParamHan)
	groupRouter.POST("/updateBtsBaseParam", groupHand.UpdateBtsBaseParamHan)
	groupRouter.POST("/deleteBtsBaseParam", groupHand.DeleteBtsBaseParamHan)
	groupRouter.POST("/getBtsBaseParamById", groupHand.GetBtsBaseParamByIdHan)
	groupRouter.POST("/getBtsBaseParamPageList", groupHand.GetBtsBaseParamPageListHan)
	groupRouter.POST("/getBtsBaseParamList", groupHand.GetBtsBaseParamListHan)

	//UDP查询操作接口
	groupRouter.POST("/getBtsOamParamDeviceHan", groupHand.GetBtsOamParamDeviceHan)
	groupRouter.POST("/getBtsOamParamNetwork", groupHand.GetBtsOamParamNetworkHan)
	groupRouter.POST("/getBtsOamParamSync", groupHand.GetBtsOamParamSyncHan)
	groupRouter.POST("/getBtsOamParamGain", groupHand.GetBtsOamParamGainHan)
	groupRouter.POST("/getBtsOamParamBts", groupHand.GetBtsOamParamBtsHan)
	groupRouter.POST("/getBtsOamParamInstall", groupHand.GetBtsOamParamInstallHan)
	groupRouter.POST("/getBtsOamParamLocationType", groupHand.GetBtsOamParamLocationTypeHan)
	groupRouter.POST("/getBtsOamParamRtc", groupHand.GetBtsOamParamRtcHan)

	//UDP设置操作接口
	groupRouter.POST("/setBtsOamParamNetwork", groupHand.SetBtsOamParamNetworkHan)
	groupRouter.POST("/setBtsOamParamSync", groupHand.SetBtsOamParamSyncHan)
	groupRouter.POST("/setBtsOamParamGain", groupHand.SetBtsOamParamGainHan)
	groupRouter.POST("/setBtsOamParamInstall", groupHand.SetBtsOamParamInstallHan)
	groupRouter.POST("/setBtsOamParamBts", groupHand.SetBtsOamParamBtsHan)
	groupRouter.POST("/setBtsOamParamLocationType", groupHand.SetBtsOamParamLocationTypeHan)
	groupRouter.POST("/setBtsOamParamRtc", groupHand.SetBtsOamParamRtcHan)

	//UDP保存参数与复位设备
	groupRouter.POST("/saveBtsOamParam", groupHand.SaveOamParamHan)
	groupRouter.POST("/resetBts", groupHand.ResetBtsHan)

}

// 基站参数移动端接口
func SetRouterMobile(r *gin.RouterGroup) {
	groupRouter := r.Group("/bparam") //路由分组
	groupHand := bparamhandler.BparamHan{}

	//请求参数解密
	groupRouter.Use(endecrypt.MobileDecryptReqParam())

	//用户登录检查，该"行"后面的接口都需要用户登录后方可操作
	groupRouter.Use(islogin.MobileIsLogin())

	//查询基站参数
	groupRouter.POST("/getMobileBtsParamList", groupHand.GetMobileBtsParamListHan)
}
