package router import ( "fmt" "gitlab.wodcloud.com/smart-operation/so-operation-api/src/common/conf" "gitlab.wodcloud.com/smart-operation/so-operation-api/src/controller" "gitlab.wodcloud.com/smart-operation/so-operation-api/src/pkg/beagle/constant" "gitlab.wodcloud.com/smart-operation/so-operation-api/src/router/middleware/header" "github.com/gin-gonic/gin" ) // 初始化登录相关路由 func InitSystemUserRouter(e *gin.Engine) { base := e.Group(fmt.Sprintf("%s/user", conf.Options.Prefix), header.SetContext) { base.GET("/:id", header.AddLogMiddleware("用户管理", "/user", constant.OpTypeIntMap[constant.Find]), controller.OrgUserDetail) //查询组织用户详情 base.GET("/select/role", header.AddLogMiddleware("用户管理", "/user/select/role", constant.OpTypeIntMap[constant.Find]), controller.OrgUserRoles) //注册平台用户使用的查询角色列表 base.POST("/add", header.AddLogMiddleware("用户管理", "/user/add", constant.OpTypeIntMap[constant.Add]), controller.OrgAddUser) //添加组织用户 base.PUT("/:id", header.AddLogMiddleware("用户管理", "/user", constant.OpTypeIntMap[constant.Edit]), controller.OrgUpdateUser) //组织编辑用户 base.DELETE("/del", header.AddLogMiddleware("用户管理", "/user/del", constant.OpTypeIntMap[constant.AllDelete]), controller.DelOrgUser) //删除组织用户 base.POST("/check", header.AddLogMiddleware("用户管理", "/user/check", constant.OpTypeIntMap[constant.Find]), controller.CheckRepetition) //去重校验 base.GET("/devOps", header.AddLogMiddleware("用户管理", "/user/devOps", constant.OpTypeIntMap[constant.Find]), controller.DevOps) //运维人员列表 base.POST("/updatePwd", header.AddLogMiddleware("用户管理", "/user/updatePwd", constant.OpTypeIntMap[constant.UpdatePwd]), controller.SystemUserEditPassword) // 修改账户密码 base.POST("/resetPwd", header.AddLogMiddleware("用户管理", "/user/resetPwd", constant.OpTypeIntMap[constant.ResetPwd]), controller.ResetSystemUserPassword) // 重置账户密码 base.POST("/updateState", header.AddLogMiddleware("用户管理", "/user/updateState", constant.OpTypeIntMap[constant.Edit]), controller.SystemUserUpdateState) // 更新用户状态 } }