wireguard-dashboard/route/user.go

22 lines
409 B
Go
Raw Normal View History

2024-03-06 17:13:29 +08:00
package route
import (
"github.com/gin-gonic/gin"
"wireguard-dashboard/http/api"
2024-03-07 11:03:46 +08:00
"wireguard-dashboard/middleware"
2024-03-06 17:13:29 +08:00
)
func UserApi(r *gin.Engine) {
2024-03-07 11:03:46 +08:00
// 登陆相关API
login := r.Group("/login")
{
login.POST("", api.UserApi().Login)
}
// 用户登陆后相关的API
2024-03-06 17:13:29 +08:00
userApi := r.Group("user")
{
2024-03-07 11:03:46 +08:00
userApi.GET("", middleware.Authorization(), api.UserApi().GetUser) // 获取登陆用户信息
2024-03-06 17:13:29 +08:00
}
}