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.

252 lines
9.3 KiB

package router
import (
"recook/internal/v2/controller/all/file"
"recook/internal/v2/controller/manage/gys/flashsale"
"recook/internal/v2/controller/supplier/after"
"recook/internal/v2/controller/supplier/brand"
"recook/internal/v2/controller/supplier/finance"
"recook/internal/v2/controller/supplier/freight"
"recook/internal/v2/controller/supplier/goods"
"recook/internal/v2/controller/supplier/gysretreat"
"recook/internal/v2/controller/supplier/message"
"recook/internal/v2/controller/supplier/order"
"recook/internal/v2/controller/supplier/qualification"
"recook/internal/v2/controller/supplier/user"
"recook/internal/v2/router/middleware"
"github.com/gin-gonic/gin"
)
// @Style 供应商后台
func routerGys(gysRouter *gin.RouterGroup) {
gysAuthorize := middleware.GysAuthorize()
userRouter := gysRouter.Group("user")
loginController := user.Login{}
{
userRouter.POST("login", loginController.Login) // 登录
userRouter.POST("logout", gysAuthorize, loginController.Logout) // 登出
userRouter.POST("reset_pwd", gysAuthorize, loginController.ResetPwd) // 修改密码
}
// 品牌
brandRouter := gysRouter.Group("brand", gysAuthorize)
brandController := brand.Brand{}
{
brandRouter.POST("lists", brandController.Lists) // 品牌列表
brandRouter.POST("info", brandController.Info) // 品牌详情
brandRouter.POST("update", brandController.Update) // 品牌更新
brandRouter.POST("create", brandController.Create) // 品牌提报
brandRouter.POST("replenish", brandController.Replenish) // 品牌资料补充
brandRouter.POST("authorize", brandController.Authorize) // 品牌授权
brandRouter.POST("/category/select", brandController.CategorySelect) // 品牌分类筛选
brandRouter.POST("/select", brandController.Select) // 品牌筛选
CBrandRouter := brandRouter.Group("change")
{
CBrandController := brand.Change{}
{
CBrandRouter.POST("change", CBrandController.Change)
CBrandRouter.POST("list", CBrandController.List)
CBrandRouter.POST("detail", CBrandController.Detail)
CBrandRouter.POST("replenish", CBrandController.Replenish)
}
}
}
fileR := gysRouter.Group("files", gysAuthorize)
{
fileController := file.Upload{}
fileR.POST("/upload/image", fileController.Image) // 图片上传
fileR.POST("/upload/video", fileController.Video) // 视频上传
fileR.POST("/upload/file", fileController.File) // 文件上传
}
freightR := gysRouter.Group("freight", gysAuthorize)
{
freightController := &freight.Freight{}
{
freightR.POST("/list", freightController.List) // 运费模版列表
freightR.POST("/add", freightController.Add) // 添加运费模版
freightR.POST("/edit", freightController.Edit) // 编辑运费模版
freightR.POST("/info", freightController.Info) // 获取运费模版详情
freightR.POST("/select", freightController.Select) // 获取运费模版详情
}
}
goodsR := gysRouter.Group("goods", gysAuthorize)
{
categoryController := &goods.Category{}
{
goodsR.POST("/category/select", categoryController.Select) // 分类筛选列表
goodsR.POST("/category/export", categoryController.Export) // 分类筛选列表
}
goodsController := &goods.Goods{}
{
goodsR.POST("/country", goodsController.Country) // 国家选择
goodsR.POST("/address", goodsController.Address) // 退货仓选择
goodsR.POST("/add", goodsController.Add) // 商品提报
goodsR.POST("/save", goodsController.Save) // 商品暂存
goodsR.POST("/detail", goodsController.Detail) // 商品详情
goodsR.POST("/tax", goodsController.Tax) // 税收分类列表
goodsR.POST("/import", goodsController.Import) // excel导入
}
boxController := &goods.Box{}
{
goodsR.POST("/box/list", boxController.List) // 草稿箱list
goodsR.POST("/box/category/search", boxController.Search) // 分类搜索
goodsR.POST("/box/delete", boxController.Delete) // 草稿删除
goodsR.POST("/modify", boxController.Modify) // 审核通过的修改
}
ReviewController := &goods.Review{}
{
goodsR.POST("/review/new/list", ReviewController.List) // 新品审核列表
goodsR.POST("/review/old/list", ReviewController.OldList) // 老品审核列表
goodsR.POST("/review/old/detail", ReviewController.OldDetail) // 老品详情
}
LibraryController := &goods.Library{}
{
goodsR.POST("/library/list", LibraryController.List) // 商品库列表
}
}
orderR := gysRouter.Group("order", gysAuthorize)
{
orderController := &order.Order{}
{
orderR.POST("list", orderController.List) // 订单列表
orderR.POST("download", orderController.Download) // 订单下载
orderR.POST("store_message", orderController.StoreMessage) // 商家备注
orderR.POST("info", orderController.Info) // 订单商品详情
orderR.POST("logs", orderController.Logs) // 订单商品操作记录
orderR.POST("pay/select", orderController.PaySelect) // 支付方式筛选
orderR.POST("download/query", orderController.DownloadQuery) // 订单查询下载
}
expressController := &order.Express{}
{
orderR.POST("express/query", expressController.Query) // 查询快递信息
orderR.POST("express/update", expressController.Update) // 更新快递信息
orderR.POST("express/mul_update", expressController.MulUpdate) // 批量发货
orderR.POST("express/select", expressController.Select) // 快递公司筛选
}
}
afterR := gysRouter.Group("after", gysAuthorize)
{
addrC := after.Addr{}
{
afterR.POST("address/create", addrC.Create)
afterR.POST("address/update", addrC.Update)
afterR.POST("address/query", addrC.Query)
afterR.POST("address/delete", addrC.Delete)
afterR.POST("address/all", addrC.All)
}
aft := after.After{}
{
afterR.POST("category", aft.Category)
afterR.POST("list", aft.QueryList)
afterR.POST("detail", aft.QueryDetail)
afterR.POST("express/order", aft.QueryOrderExpress)
afterR.POST("express/detail", aft.QueryAFTExpress)
}
}
qualificationR := gysRouter.Group("qualification", gysAuthorize)
{
var q qualification.Qualification
qualificationR.POST("detail", q.Detail)
qualificationR.POST("sector/update", q.UpdateSector)
qualificationR.POST("license/recognize", q.License)
qualificationR.POST("base", q.BaseInfo)
qualificationR.POST("source", q.Source)
qualificationR.POST("submit", q.Submit)
qualificationR.POST("update", q.UpdateEntry)
}
//供应商消息中心模块
messageGysRouter := gysRouter.Group("gys_message", gysAuthorize)
{
messageController := message.GysMessage{}
{
//显示全部消息
messageGysRouter.POST("view_all", messageController.ViewAll)
// 显示待办事项
messageGysRouter.POST("to_do_list", messageController.DoList)
//显示多个系统消息详情
messageGysRouter.POST("system_one", messageController.SystemList)
// 已读接口
messageGysRouter.POST("read_end", messageController.ReadEnd)
}
}
GysRetreatRouter := gysRouter.Group("gys_retreat", gysAuthorize)
{
GysRetreatController := gysretreat.ControllerGysRetreat{}
{
GysRetreatRouter.POST("gys_sms", GysRetreatController.Sms) //发起手机号验证
GysRetreatRouter.POST("gys_leaver", GysRetreatController.Retread) //验证,并供应商退驻
GysRetreatRouter.POST("gys_is_retreat", GysRetreatController.IsRetread) //是否退驻
}
}
// 财务
financeRouter := gysRouter.Group("finance", gysAuthorize)
{
billController := finance.Bill{}
{
financeRouter.POST("lists", billController.Lists)
financeRouter.POST("export", billController.Export)
}
}
OrderNoticeRouter := gysRouter.Group("order_notice", gysAuthorize)
{
//供应商订单延迟报备
gysDYNcontroller := order.DelayedNotification{}
{
OrderNoticeRouter.POST("add", gysDYNcontroller.Add)
OrderNoticeRouter.POST("list", gysDYNcontroller.List)
OrderNoticeRouter.POST("list_one_detail", gysDYNcontroller.ListOne)
}
}
//秒杀活动
gysFlashSaleRouter := gysRouter.Group("flash_sale_activity", gysAuthorize)
{
gysFlashController := flashsale.RecookFlashController{}
//list
gysFlashSaleRouter.POST("view_list", gysFlashController.View)
// add
gysFlashSaleRouter.POST("add_activity", gysFlashController.Add)
//show_goods
gysFlashSaleRouter.POST("show_goods", gysFlashController.ShowGoods)
//供应商撤回报名
gysFlashSaleRouter.POST("withdraw", gysFlashController.Withdraw)
//临时商品展示
gysFlashSaleRouter.POST("temp_list", gysFlashController.TempList)
//add
gysFlashSaleRouter.POST("temp_add", gysFlashController.TempAdd)
//删除
gysFlashSaleRouter.POST("temp_del", gysFlashController.TempDel)
//update
gysFlashSaleRouter.POST("temp_update", gysFlashController.TempUpdate)
}
GysPurchaseRouter := gysRouter.Group("gys_purchase", gysAuthorize)
{ //供应商提交修改供货价
GysPurchaseContro := goods.GysPurchaseController{}
{
GysPurchaseRouter.POST("show_list", GysPurchaseContro.List) //展示列表
GysPurchaseRouter.POST("created", GysPurchaseContro.Created) //新增
GysPurchaseRouter.POST("del", GysPurchaseContro.DEl) //撤回
}
}
}