You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.1 KiB
48 lines
1.1 KiB
package router
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"live/app/controller/goods"
|
|
"live/app/controller/user"
|
|
"live/app/router/middleware"
|
|
)
|
|
|
|
func Router(router *gin.Engine) {
|
|
liveRouter := router.Group("/api/v1/live")
|
|
liveRouter.Use(middleware.Decrypt())
|
|
{
|
|
// 橱柜
|
|
cupboardR := liveRouter.Group("/cupboard")
|
|
cupboardR.Use(middleware.Auth())
|
|
{
|
|
cupboard := &goods.Cupboard{}
|
|
cupboardR.POST("list", cupboard.List) // 会员橱柜列表
|
|
cupboardR.POST("delete", cupboard.Delete) // 会员橱柜商品删除
|
|
}
|
|
// 商品
|
|
goodsR := liveRouter.Group("/goods")
|
|
{
|
|
goodsC := &goods.Goods{}
|
|
goodsR.POST("list", goodsC.List)
|
|
goodsR.POST("brandlist", goodsC.BrandList)
|
|
goodsR.POST("brandgoodslist", goodsC.BrandGoodsList)
|
|
}
|
|
// 会员
|
|
userR := liveRouter.Group("/user")
|
|
{
|
|
followC := &user.Follow{}
|
|
bothAutoR := userR.Group("follow")
|
|
bothAutoR.Use(middleware.BothAuth())
|
|
bothAutoR.POST("list", followC.List)
|
|
|
|
followR := userR.Group("follow")
|
|
followR.Use(middleware.Auth())
|
|
{
|
|
followR.POST("add", followC.Add)
|
|
followR.POST("cancel", followC.Cancel)
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|