sys_user.go 1.4 KB

12345678910111213141516171819202122232425262728
  1. package system
  2. import (
  3. v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
  4. "github.com/flipped-aurora/gin-vue-admin/server/middleware"
  5. "github.com/gin-gonic/gin"
  6. )
  7. type UserRouter struct {
  8. }
  9. func (s *UserRouter) InitUserRouter(Router *gin.RouterGroup) {
  10. userRouter := Router.Group("user").Use(middleware.OperationRecord())
  11. var baseApi = v1.ApiGroupApp.SystemApiGroup.BaseApi
  12. {
  13. userRouter.POST("register", baseApi.Register) // 用户注册账号
  14. userRouter.POST("changePassword", baseApi.ChangePassword) // 用户修改密码
  15. userRouter.POST("getUserList", baseApi.GetUserList) // 分页获取用户列表
  16. userRouter.POST("getUserPList", baseApi.GetUserPList) // 分页获取用户列表
  17. userRouter.POST("setUserAuthority", baseApi.SetUserAuthority) // 设置用户权限
  18. userRouter.DELETE("deleteUser", baseApi.DeleteUser) // 删除用户
  19. userRouter.PUT("setUserInfo", baseApi.SetUserInfo) // 设置用户信息
  20. userRouter.PUT("setUserName", baseApi.SetUserName) // 设置用户信息
  21. userRouter.POST("setUserAuthorities", baseApi.SetUserAuthorities) // 设置用户权限组
  22. userRouter.GET("getUserInfo", baseApi.GetUserInfo) // 获取自身信息
  23. userRouter.GET("getUserInfoById", baseApi.GetUserInfoById) // 获取自身信息
  24. }
  25. }