123456789101112131415161718192021222324252627282930313233343536373839 |
- package system
- import (
- "github.com/gin-gonic/gin"
- v1 "lc-fangdaosha/api/v1"
- "lc-fangdaosha/middleware"
- )
- type UserRouter struct{}
- func (s *UserRouter) InitUserRouter(Router, PubRouter *gin.RouterGroup) {
- userRouter := Router.Group("user").Use(middleware.OperationRecord())
- userRouterWithoutRecord := Router.Group("user")
- baseApi := v1.ApiGroupApp.SystemApiGroup.BaseApi
- {
- userRouter.POST("admin_register", baseApi.Register) // 管理员注册账号
- userRouter.POST("changePassword", baseApi.ChangePassword) // 用户修改密码
- userRouter.POST("setUserAuthority", baseApi.SetUserAuthority) // 设置用户权限
- userRouter.DELETE("deleteUser", baseApi.DeleteUser) // 删除用户
- userRouter.PUT("setUserInfo", baseApi.SetUserInfo) // 设置用户信息
- userRouter.PUT("setSelfInfo", baseApi.SetSelfInfo) // 设置自身信息
- userRouter.POST("setUserAuthorities", baseApi.SetUserAuthorities) // 设置用户权限组
- userRouter.POST("resetPassword", baseApi.ResetPassword) // 设置用户权限组
- userRouter.POST("addEmails", baseApi.AddEmails) //管理员邦定游戏
- userRouter.PUT("unbindEmail", baseApi.UnbindEmail) //管理员解绑报警邮箱
- }
- {
- userRouterWithoutRecord.POST("getUserList", baseApi.GetUserList) // 分页获取用户列表
- userRouterWithoutRecord.GET("getUserInfo", baseApi.GetUserInfo) // 获取自身信息
- userRouter.GET("ids", baseApi.UserIdList) //获取用户id,username列表
- }
- //无需认证
- userPubGroup := PubRouter.Group("user")
- {
- userPubGroup.GET("confirm", baseApi.ConfirmEmail) //确认邮件
- userPubGroup.GET("userUnbindEmail", baseApi.UserUnbindEmail) //用户解绑报警邮箱
- }
- }
|