wireguard-dashboard/http/router/user.go

26 lines
1022 B
Go
Raw Normal View History

2024-07-05 14:41:35 +08:00
package router
import (
"github.com/gin-gonic/gin"
"wireguard-ui/http/api"
"wireguard-ui/http/middleware"
)
// UserApi
// @description: 用户相关API
// @param r
func UserApi(r *gin.RouterGroup) {
userApi := r.Group("user", middleware.Authorization())
{
userApi.GET("/info", api.User().GetLoginUser) // 获取当前登陆用户信息
userApi.POST("", api.User().SaveUser) // 新增/编辑用户
userApi.DELETE("/:id", api.User().Delete) // 删除用户
userApi.GET("/list", api.User().List) // 分页列表
userApi.PUT("/status/:id", api.User().Status) // 修改用户状态
userApi.PUT("/change-password", api.User().ChangePassword) // 修改用户密码
userApi.PUT("/reset-password/:id", api.User().ResetPassword) // 重置用户密码
2024-07-11 16:12:46 +08:00
userApi.POST("/generate-avatar", api.User().GenerateAvatar) // 生成头像
2024-08-06 14:49:05 +08:00
userApi.POST("/logout", api.Login().Logout) // 退出登陆
2024-07-05 14:41:35 +08:00
}
}