package ims_user

import (
	"be.ems/src/framework/middleware"
	"be.ems/src/framework/middleware/collectlogs"
	"be.ems/src/framework/middleware/repeat"

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

// @Description Register Routes for ims_user
func Register(r *gin.RouterGroup) {

	volteUserGroup := r.Group("/volte/user")
	{
		volteUserGroup.PUT("/resetData/:neId",
			repeat.RepeatSubmit(5),
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.volteUser", collectlogs.BUSINESS_TYPE_CLEAN)),
			NewController.ResetData,
		)
		volteUserGroup.GET("/list",
			middleware.PreAuthorize(nil),
			NewController.List,
		)
		volteUserGroup.GET("/:neId/:imsi",
			middleware.PreAuthorize(nil),
			NewController.Info,
		)
		volteUserGroup.POST("/:neId",
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.volteUser", collectlogs.BUSINESS_TYPE_INSERT)),
			NewController.Add,
		)
		volteUserGroup.POST("/:neId/:num",
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.volteUser", collectlogs.BUSINESS_TYPE_INSERT)),
			NewController.Adds,
		)
		volteUserGroup.PUT("/:neId",
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.volteUser", collectlogs.BUSINESS_TYPE_UPDATE)),
			NewController.Edit,
		)
		volteUserGroup.DELETE("/:neId/:imsi",
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.volteUser", collectlogs.BUSINESS_TYPE_DELETE)),
			NewController.Remove,
		)
		volteUserGroup.DELETE("/:neId/:imsi/:num",
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.volteUser", collectlogs.BUSINESS_TYPE_DELETE)),
			NewController.Removes,
		)
		volteUserGroup.POST("/export",
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.volteUser", collectlogs.BUSINESS_TYPE_EXPORT)),
			NewController.Export,
		)
		volteUserGroup.POST("/import",
			middleware.PreAuthorize(nil),
			collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.volteUser", collectlogs.BUSINESS_TYPE_IMPORT)),
			NewController.Import,
		)
	}
}

