package router

import (
	"github.com/gin-gonic/gin"
	"go-admin/app/admin/apis/goodsmanage"
	"go-admin/app/admin/apis/ordermanage"
	"go-admin/app/admin/middleware"
	jwt "go-admin/pkg/jwtauth"
)

// 需认证的路由代码
func registerOrderManageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	order := v1.Group("/order").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
	{
		order.POST("/list", ordermanage.OrderList)              // 订单列表
		order.POST("/list_export", ordermanage.OrderListExport) // 订单列表导出
	}

}

// 无需认证的路由代码
func registerOrderManageUnAuthRouter(v1 *gin.RouterGroup) {
	order := v1.Group("/order")
	{
		//order.POST("/list", ordermanage.OrderList)                         // 订单列表
		order.POST("/info", ordermanage.OrderInfo)                         // 订单详情
		order.POST("/deliver_goods", ordermanage.DeliverGoods)             // 订单发货
		order.POST("/revert_goods", ordermanage.RevertGoods)               // 订单归还
		order.POST("express_company/list", ordermanage.ExpressCompanyList) // 物流公司列表
		order.POST("/modify", goodsmanage.GameCardModify)                  // 修改游戏
		order.POST("/del", ordermanage.OrderDel)                           // 订单删除
		order.POST("/refund", ordermanage.OrderRefund)                     // 订单退款
		order.POST("/express_no/list", ordermanage.ExpressNoList)          // 物流单列表
		order.POST("/fund_record/list", ordermanage.FundRecordList)        // 财务统计列表

		//order.POST("/type", goodsmanage.GameCardTypes)             // 获取游戏类型
	}

}
