🎨 新增酒单CRUD & 喜欢的酒单列表CRUD
parent
d6e256ef9e
commit
1212e999cc
@ -0,0 +1,13 @@
|
|||||||
|
package entity
|
||||||
|
|
||||||
|
import "Lee-WineList/common/types"
|
||||||
|
|
||||||
|
type LikeWine struct {
|
||||||
|
types.BaseDbModel
|
||||||
|
UserId int `gorm:"column:user_id;type:int(11) unsigned;comment:用户ID;NOT NULL" json:"user_id"`
|
||||||
|
WineId int `gorm:"column:wine_id;type:int(11) unsigned;comment:酒ID;NOT NULL" json:"wine_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (LikeWine) TableName() string {
|
||||||
|
return "like_wines"
|
||||||
|
}
|
@ -1,13 +1,12 @@
|
|||||||
package router
|
package router
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"Lee-WineList/middleware"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
// InitRoute 初始化路由
|
// InitRoute 初始化路由
|
||||||
func InitRoute(g *gin.RouterGroup) {
|
func InitRoute(g *gin.RouterGroup) {
|
||||||
login(g) // 登录相关路由
|
login(g) // 登录相关路由
|
||||||
user(g.Group("/user", middleware.AuthorizeToken())) // 用户相关路由
|
user(g.Group("/user")) // 用户相关路由
|
||||||
wine(g.Group("/wine"))
|
wine(g.Group("/wine"))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue