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.

210 lines
7.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package router
import (
"recook/internal/v2/controller/app/abroad"
"recook/internal/v2/controller/app/activeBit"
"recook/internal/v2/controller/app/akuschool"
"recook/internal/v2/controller/app/command"
"recook/internal/v2/controller/app/evaluation"
"recook/internal/v2/controller/app/jcook"
"recook/internal/v2/controller/app/message"
"recook/internal/v2/controller/app/operate"
"recook/internal/v2/controller/app/order"
"recook/internal/v2/controller/app/productportrait"
"recook/internal/v2/controller/app/seckill"
"recook/internal/v2/controller/app/shoppingcart"
"recook/internal/v2/controller/app/upgrade"
"recook/internal/v2/controller/app/user"
"recook/internal/v2/router/middleware"
"github.com/gin-gonic/gin"
)
// @Style recook总后台
func routerApp(appRouter *gin.RouterGroup) {
authorize := middleware.AppAuthorize()
appRouter.Use(middleware.AppVersion) // 版本拦截
//postman 测试用
// appRouter.Use(secure.FakeEcrypt())
appRouter.Use(middleware.Decrypt())
userRouter := appRouter.Group("user", authorize)
{
infoController := user.Info{}
{
userRouter.POST("update", infoController.Update) // 会员信息更新
userRouter.POST("member/income_data", infoController.IncomeData) // 会员收益数据
userRouter.POST("secret", infoController.Secret) // 会员隐私开关
userRouter.POST("sale", infoController.Sale) // 本人销售
}
balanceController := user.Balance{}
{
userRouter.POST("balance/info", balanceController.Info) // 余额详情
userRouter.POST("balance/month_history", balanceController.MonthHistory) // 月余额记录
}
incomeController := user.Income{}
{
userRouter.POST("profit", incomeController.Profit)
userRouter.POST("team", incomeController.Team)
userRouter.POST("income/purchase_accumulate", incomeController.PurchaseAccumulate) // 累计自购收益
userRouter.POST("income/guide_accumulate", incomeController.GuideAccumulate) // 累计导购收益
userRouter.POST("income/history", incomeController.History) // 历史收益数据
userRouter.POST("income/nr/detail", incomeController.IncomeNotRecvDetail) // 未到账详情
userRouter.POST("income/detail", incomeController.IncomeDetail) // 到账详情
}
operateController := user.Operate{}
{
userRouter.POST("operation/destroy", operateController.DestroyWithCode)
}
}
orderRouter := appRouter.Group("order", authorize)
{
orderController := order.Order{}
{
orderRouter.POST("lists", orderController.Lists) // 订单列表
orderRouter.POST("guide_lists", orderController.GuideLists) // 导购订单列表
//以下为app端发票相关接口
//可开发票列表
orderRouter.POST("can_bill_list", orderController.CanBillList)
//用户填入申请开票资料
orderRouter.POST("apply_invoice", orderController.ApplyInvoice)
//用户添加常用开票抬头(包括修改功能)
orderRouter.POST("add_invoice_title", orderController.AddInvoiceTitle)
//显示用户抬头列表
orderRouter.POST("invoice_user_list", orderController.FindAllTitle)
//app用户显示用户开票记录
orderRouter.POST("invoice_history", orderController.InvoiceHistory)
//展示发票订单详情
orderRouter.POST("invoice_order_detail", orderController.InvoiceOrderDetail)
// 显示发票详情
orderRouter.POST("invoice_one_detail", orderController.ViewOneDetail)
}
}
commandRouter := appRouter.Group("command")
{
commandController := command.Command{}
{
commandRouter.POST("generate", commandController.Generate) // 生成
commandRouter.POST("analysis", commandController.Analysis) // 解析
}
userController := command.User{}
{
commandRouter.POST("user/info", userController.Info) // 会员信息
commandRouter.POST("user/unbundling_wx", userController.UnbundingWX) //解绑微信
}
}
messageRouter := appRouter.Group("message", authorize)
{
messageController := message.Message{}
{
messageRouter.POST("destroy/send", messageController.SendDestroyMessage)
}
}
OperateRouter := appRouter.Group("operate")
{
scanController := operate.Scan{}
{
OperateRouter.POST("scan", scanController.Scan)
}
}
abroadRouter := appRouter.Group("abroad")
{
abroadController := abroad.GoodsAbroad
//选择国家
abroadRouter.POST("countryList", abroadController.ViewCountry)
//选择商品类目
abroadRouter.POST("category_list", abroadController.SelectCategory)
//查询商品已合并到v1的搜索中不需在这里维护
abroadRouter.POST("view_goods", abroadController.ViewGoods)
//搜索国家
abroadRouter.POST("search_country", abroadController.SearchCountry)
}
jCookRouter := appRouter.Group("jcook")
{
proxy := jcook.Proxy{}
jCookRouter.POST("category", proxy.Category)
jCookRouter.POST("stock", proxy.Stock)
}
akuschoolRouter := appRouter.Group("aku_school")
{
akucontroller := &akuschool.AkuSchoolController{}
akuschoolRouter.POST("school_list", akucontroller.Show)
akuschoolRouter.POST("add_hits", akucontroller.AddHits)
}
kingRouter := appRouter.Group("aku_school")
{
akucontroller := &akuschool.AkuSchoolController{}
//显示--金刚区图标--
kingRouter.POST("king_coin_list", akucontroller.ViewListKing)
kingRouter.POST("king_coin_list_new", akucontroller.ViewListKingNew)
//回显综合搜索关键词
kingRouter.POST("search_word", akucontroller.SearchWord)
}
//评价图文审核模块
evaRouter := appRouter.Group("evaluation", authorize)
{
evaController := evaluation.AppEvaluation{}
evaRouter.POST("del_image_video", evaController.Del)
//活跃人数统计
evaRouter.POST("active_people", evaController.Active) //运营模块追加内容
}
//购物车模块找相似和搜索关联
shoppingCartRouter := appRouter.Group("shopping_cart", authorize)
{
shoppingCtl := shoppingcart.ShoppingController{}
shoppingCartRouter.POST("view_like", shoppingCtl.ViewLike)
shoppingCartRouter.POST("view_like_maybe", shoppingCtl.ViewLikeMaybe)
shoppingCartRouter.POST("missing_children", shoppingCtl.Children)
}
//app端展示轮播图和t1-t4位
activeBitRouter := appRouter.Group("active_bit")
activebitController := activeBit.ControllerActiveBit{}
{
//轮播图
activeBitRouter.POST("diamond_show/list", activebitController.ViewDiamondList)
//t1-t4展示
activeBitRouter.POST("type_show/list", activebitController.ViewTypeList)
//展示榜单
//activeBitRouter.POST("recommend/list", activebitController.ViewRecommendList)
}
{
productRouter := appRouter.Group("product_portrait")
//产品画像
productorController := productportrait.ControllerProductPortrait{}
{
productRouter.POST("goods_detail_about", productorController.DetailAbout)
}
}
//显示秒杀榜单
seckillRouter := appRouter.Group("flash_sale")
{
seckillController := seckill.RecookSecKillAppController{}
//show list
seckillRouter.POST("show_list", seckillController.ShowList)
}
upgradeRouter := appRouter.Group("apply", authorize)
{
proxy := upgrade.Proxy{}
{
upgradeRouter.POST("list", proxy.List)
upgradeRouter.POST("create", proxy.Create)
upgradeRouter.POST("send", proxy.Send)
}
}
}