sys_user.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package system
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "lcfns/api/v1"
  5. "lcfns/middleware"
  6. )
  7. type UserRouter struct{}
  8. func (s *UserRouter) InitUserRouter(Router, PubRouter *gin.RouterGroup) {
  9. userRouter := Router.Group("user").Use(middleware.OperationRecord())
  10. userRouterWithoutRecord := Router.Group("user")
  11. baseApi := v1.ApiGroupApp.SystemApiGroup.BaseApi
  12. {
  13. userRouter.POST("admin_register", baseApi.Register) // 管理员注册账号
  14. userRouter.POST("changePassword", baseApi.ChangePassword) // 用户修改密码
  15. userRouter.POST("setUserAuthority", baseApi.SetUserAuthority) // 设置用户权限
  16. userRouter.DELETE("deleteUser", baseApi.DeleteUser) // 删除用户
  17. userRouter.PUT("setUserInfo", baseApi.SetUserInfo) // 设置用户信息
  18. userRouter.PUT("setSelfInfo", baseApi.SetSelfInfo) // 设置自身信息
  19. userRouter.POST("setUserAuthorities", baseApi.SetUserAuthorities) // 设置用户权限组
  20. userRouter.POST("resetPassword", baseApi.ResetPassword) // 设置用户权限组
  21. userRouter.POST("addEmails", baseApi.AddEmails)
  22. userRouter.POST("unbindEmail", baseApi.UnbindEmail)
  23. }
  24. {
  25. userRouterWithoutRecord.POST("getUserList", baseApi.GetUserList) // 分页获取用户列表
  26. userRouterWithoutRecord.GET("getUserInfo", baseApi.GetUserInfo) // 获取自身信息
  27. userRouter.GET("ids", baseApi.UserIdList)
  28. }
  29. //无需认证
  30. userPubGroup := PubRouter.Group("user")
  31. {
  32. userPubGroup.GET("confirm", baseApi.ConfirmEmail)
  33. userPubGroup.GET("userUnbindEmail", baseApi.UserUnbindEmail)
  34. }
  35. }