重新初始化项目

This commit is contained in:
2023-04-27 15:56:12 +08:00
parent 10546eb629
commit d6e256ef9e
50 changed files with 1255 additions and 308 deletions

View File

@@ -1,8 +1,7 @@
package app
package router
import (
"Lee-WineList/api/app"
"Lee-WineList/middleware"
"github.com/gin-gonic/gin"
)
@@ -10,6 +9,6 @@ import (
func login(g *gin.RouterGroup) {
// 登录相关接口
g.POST("/token", app.LoginApi().Login)
g.POST("/token/refresh", app.LoginApi().Refresh)
g.POST("/token/logout", middleware.AuthorizeToken(), app.LoginApi().Logout)
//g.POST("/token/refresh", app.LoginApi().Refresh)
//g.POST("/token/logout", middleware.AuthorizeToken(), app.LoginApi().Logout)
}

View File

@@ -1,4 +1,4 @@
package app
package router
import (
"Lee-WineList/middleware"
@@ -9,4 +9,5 @@ import (
func InitRoute(g *gin.RouterGroup) {
login(g) // 登录相关路由
user(g.Group("/user", middleware.AuthorizeToken())) // 用户相关路由
wine(g.Group("/wine"))
}

View File

@@ -1,4 +1,4 @@
package app
package router
import (
"Lee-WineList/api/app"

10
router/wine.go Normal file
View File

@@ -0,0 +1,10 @@
package router
import (
"Lee-WineList/api/app"
"github.com/gin-gonic/gin"
)
func wine(g *gin.RouterGroup) {
g.GET("", app.WineApi().GetList)
}