package trace

import (
	"ems.agt/src/framework/logger"
	"ems.agt/src/framework/middleware"
	"ems.agt/src/framework/middleware/collectlogs"
	"ems.agt/src/modules/trace/controller"

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

// 模块路由注册
func Setup(router *gin.Engine) {
	logger.Infof("开始加载 ====> trace 模块路由")

	// 信令抓包
	tcpdumpGroup := router.Group("/tcpdump")
	{
		tcpdumpGroup.POST("/ne",
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("Signaling Grab", collectlogs.BUSINESS_TYPE_OTHER)),
			controller.NewTcpdump.NeTask,
		)
		tcpdumpGroup.POST("/neUPF",
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("Signaling Grab", collectlogs.BUSINESS_TYPE_OTHER)),
			controller.NewTcpdump.NeUPFTask,
		)
		tcpdumpGroup.POST("/download",
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("Signaling Grab", collectlogs.BUSINESS_TYPE_IMPORT)),
			controller.NewTcpdump.Download,
		)
	}
}
