50 lines
1.6 KiB
Go
50 lines
1.6 KiB
Go
package router
|
|
|
|
import (
|
|
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
|
|
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
|
|
service_meal "github.com/fonchain_enterprise/fonchain-main/pkg/service/meal"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func MealRoute(r *gin.RouterGroup) {
|
|
r = r.Group("meal")
|
|
noAuth := r.Group("")
|
|
auth := r.Group("")
|
|
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
|
|
//需要登陆保护
|
|
userAuth := auth.Group("user")
|
|
{
|
|
userAuth.POST("list", service_meal.UserList)
|
|
}
|
|
userNoAuth := noAuth.Group("user")
|
|
{
|
|
userNoAuth.POST("info-phone", service_meal.InfoPhone)
|
|
}
|
|
|
|
goods := auth.Group("goods")
|
|
{
|
|
goods.POST("category-plate-list", service_meal.CategoryPlateList)
|
|
goods.POST("category-list", service_meal.CategoryGoodsList)
|
|
goods.POST("update-category-goods", service_meal.UpdateCategoryGoods)
|
|
goods.POST("update-feast", service_meal.UpdateFeast)
|
|
goods.POST("update-box-meal", service_meal.UpdateBoxMeal)
|
|
goods.POST("update-drink", service_meal.UpdateDrink)
|
|
}
|
|
|
|
// 不需要登录的接口
|
|
orderNoAuth := noAuth.Group("order")
|
|
{
|
|
orderNoAuth.POST("order-data-h5", service_meal.OrderDataH5)
|
|
}
|
|
|
|
//管理系统订单和用户列表
|
|
indent := noAuth.Group("/indent")
|
|
{
|
|
indent.Use(middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
|
|
indent.POST("/userlist", service_meal.UserListMtgt)
|
|
indent.POST("/goodlist", service_meal.IndentList)
|
|
indent.POST("pay/refunds", service_meal.Orderback) //退款
|
|
}
|
|
}
|