package router

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

// 需认证的路由代码
func registerCooperativeManageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {

	cooperativeBusiness := v1.Group("/cooperative").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
	{
		cooperativeBusiness.POST("get_default_info", cooperativemanage.CooperativeGetDefaultInfo)                              // 获取合作商默认用户名和密码
		cooperativeBusiness.POST("list", cooperativemanage.CooperativeBusinessList)                                            // 获取合作商列表
		cooperativeBusiness.POST("add", cooperativemanage.CooperativeAdd)                                                      // 获取合作商
		cooperativeBusiness.POST("edit", cooperativemanage.CooperativeEdit)                                                    // 编辑供应商
		cooperativeBusiness.POST("member_promotion/list", cooperativemanage.CooperativeMemberPromotionList)                    // 合作商推广会员列表
		cooperativeBusiness.POST("member_promotion_store/list", cooperativemanage.CooperativeMemberPromotionStoreList)         // 合作商推广会员门店列表
		cooperativeBusiness.POST("member_promotion_day/list", cooperativemanage.CooperativeMemberPromotionDayList)             // 合作商每天推广会员列表
		cooperativeBusiness.POST("member_promotion_store_day/list", cooperativemanage.CooperativeMemberPromotionStoreDayList)  // 合作商每天门店推广会员列表
		cooperativeBusiness.POST("member_promotion_statistic/list", cooperativemanage.CooperativeMemberPromotionStatisticList) // 合作商推广会员统计列表
		cooperativeBusiness.POST("member_promotion/settle_info", cooperativemanage.CooperativeMemberPromotionSettleInfo)       // 合作商推广会员结算详情
		cooperativeBusiness.POST("member_promotion/settle_confirm", cooperativemanage.CooperativeMemberPromotionSettleConfirm) // 合作商推广会员结算确认
		//cooperativeBusiness.POST("member_promotion/settle/list", cooperativemanage.CooperativeMemberPromotionSettleList)       // 合作商推广会员结算列表

		cooperativeBusiness.POST("member_promotion/settle_remit", cooperativemanage.CooperativeMemberPromotionSettleRemit) // 合作商推广会员结算打款
		cooperativeBusiness.POST("member_promotion/assistant_report", cooperativemanage.AssistantInviteMemberReportList)   // 合作商推广会员结算详情
		cooperativeBusiness.POST("member_list", cooperativemanage.CooperativePromotionMemberList)                          // 获取合作商会员列表
		cooperativeBusiness.POST("member_deduct_update", cooperativemanage.UpdateCooperativeMemberDeduct)                  // 修改合作商会员佣金配置
		cooperativeBusiness.POST("store_member_deduct_update", cooperativemanage.UpdateCooperativeMemberStoreDeduct)       // 修改合作商会员佣金配置
		cooperativeBusiness.POST("order_list", cooperativemanage.CooperativeOrderList)                                     // 合作商借卡单列表
		cooperativeBusiness.POST("store_list", cooperativemanage.CooperativeStoreList)                                     // 用户门店列表
		cooperativeBusiness.POST("goods_list", cooperativemanage.CooperativeGameCardGoodsList)                             // 获取游戏卡列表
		cooperativeBusiness.POST("stock_list", cooperativemanage.CooperativeGameCardStockList)                             // 合作商库存列表
		cooperativeBusiness.POST("cannibalize_task_list", cooperativemanage.CooperativeCannibalizeTaskList)                // 合作商调拨任务列表
		cooperativeBusiness.POST("stock_export", cooperativemanage.CooperativeStockExport)                                 // 合作商库存导出
		cooperativeBusiness.POST("member_promotion_export", cooperativemanage.CooperativeMemberPromotionExport)            // 合作商推广会员导出
		cooperativeBusiness.POST("set_pay_info", cooperativemanage.CooperativeSetPayInfo)                                  // 设置支付信息
		cooperativeBusiness.POST("get_pay_info", cooperativemanage.CooperativeGetPayInfo)                                  // 获取支付信息
	}
}

// 无需认证的路由代码
func registerCooperativeManageUnAuthRouter(v1 *gin.RouterGroup) {
	cooperativeBusiness := v1.Group("/cooperative")
	cooperativeBusiness.POST("member_promotion/settle/list", cooperativemanage.CooperativeMemberPromotionSettleList) // 合作商推广会员结算列表
	//cooperativeBusiness.POST("member_promotion_statistic/list", cooperativemanage.CooperativeMemberPromotionStatisticList) // 合作商推广会员统计列表
}
