package router

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

// 需认证的路由代码
func registerStockManageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	order := v1.Group("/stock").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
	{
		order.POST("/list", stockmanage.GameCardGoodsStockInfoList)               // 库存列表
		order.POST("/cannibalize_task/list", stockmanage.CannibalizeTaskList)     // 库存调拨列表
		order.POST("/cannibalize_task/detail", stockmanage.CannibalizeTaskDetail) // 库存调拨明细

		order.POST("/card/dels", stockmanage.GameCardGoodsStockDels)       // 游戏卡减库存/出库
		order.POST("/out_list", stockmanage.GameCardGoodsStockOutInfoList) // 出库明细

		order.POST("/cannibalize_task/create", stockmanage.CannibalizeTaskCreate) // 创建调拨
	}
}

// 无需认证的路由代码
func registerStockManageUnAuthRouter(v1 *gin.RouterGroup) {
	order := v1.Group("/stock")
	{
		//order.POST("/list", stockmanage.GameCardGoodsStockInfoList)                // 库存列表
		//order.POST("/card/dels", stockmanage.GameCardGoodsStockDels)               // 游戏卡减库存/出库
		order.POST("/card/list", stockmanage.GameCardGoodsStockCardList)           // 游戏卡列表
		order.POST("/card/adds", stockmanage.GameCardGoodsStockAdds)               // 游戏卡入库
		order.POST("/card/stock_derive", stockmanage.ExportDataGameCardGoodsStock) //

		//order.POST("/cannibalize_task/create", stockmanage.CannibalizeTaskCreate)                    // 创建调拨
		order.POST("/cannibalize_task/import_goods", stockmanage.CannibalizeTaskImportGameCardGoods) // 导入调拨卡带信息
		order.POST("/cannibalize_task/deliver_goods", stockmanage.CannibalizeTaskDeliverGoods)       // 调拨发货
		order.POST("/cannibalize_task/put_in_storage", stockmanage.CannibalizeTaskPutInStorage)      // 调拨收货
		order.POST("/cannibalize_task/goods_list", stockmanage.CannibalizeTaskGameCardGoodsList)     // 调拨游戏卡列表
		order.POST("/cannibalize_task/del", stockmanage.CannibalizeTaskDel)                          // 删除调拨任务
		//order.POST("/type", goodsmanage.GameCardTypes)             // 获取游戏类型
		//order.POST("/cannibalize_task/list", stockmanage.CannibalizeTaskList)                        // 库存调拨列表
	}

}
