package route import ( "github.com/gin-gonic/gin" "wireguard-dashboard/http/api" "wireguard-dashboard/middleware" ) func UserApi(r *gin.Engine) { // 登陆相关API login := r.Group("/login") { login.POST("", api.UserApi().Login) } // 用户登陆后相关的API userApi := r.Group("user", middleware.Authorization()) { userApi.DELETE("logout", api.UserApi().Logout) // 用户退出登陆 userApi.GET("", api.UserApi().GetUser) // 获取登陆用户信息 userApi.POST("save", api.UserApi().Save) // 新增/编辑用户信息 userApi.POST("change-password", api.UserApi().ChangePassword) // 更改密码 userApi.GET("list", api.UserApi().List) // 用户列表 userApi.PUT("change-status", api.UserApi().ChangeUserState) // 变更状态 } }