22 lines
409 B
Go
22 lines
409 B
Go
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")
|
|
{
|
|
userApi.GET("", middleware.Authorization(), api.UserApi().GetUser) // 获取登陆用户信息
|
|
}
|
|
}
|