package airDrop

import (
	"github.com/gin-gonic/gin"
	"courseSign/server/api/v1"
	"courseSign/server/middleware"
)

type RedPackageRouter struct {
}

// InitRedPackageRouter 初始化 RedPackage 路由信息
func (s *RedPackageRouter) InitRedPackageRouter(Router *gin.RouterGroup) {
	redPackageRouter := Router.Group("redPackage").Use(middleware.OperationRecord())
	redPackageRouterWithoutRecord := Router.Group("redPackage")
	var redPackageApi = v1.ApiGroupApp.AirDropApiGroup.RedPackageApi
	{
		redPackageRouter.POST("createRedPackage", redPackageApi.CreateRedPackage)             // 新建RedPackage
		redPackageRouter.DELETE("deleteRedPackage", redPackageApi.DeleteRedPackage)           // 删除RedPackage
		redPackageRouter.DELETE("deleteRedPackageByIds", redPackageApi.DeleteRedPackageByIds) // 批量删除RedPackage
		redPackageRouter.PUT("updateRedPackage", redPackageApi.UpdateRedPackage)              // 更新RedPackage
	}
	{
		redPackageRouterWithoutRecord.GET("getWhiteList", redPackageApi.GetWhiteList)       // 根据ID获取RedPackage对应的whitelist
		redPackageRouterWithoutRecord.POST("convertWhiteList", redPackageApi.ConvertWhiteList)       // 根据xlsx 获取whitelist 列表
		redPackageRouterWithoutRecord.GET("getRedPackageListBackend", redPackageApi.GetRedPackageList) // 获取RedPackage列表
		redPackageRouterWithoutRecord.GET("queryBalance",redPackageApi.QueryBalance) // 获取地址余额
	}
}

func (s *RedPackageRouter) InitRedPackagePubRouter(Router *gin.RouterGroup) {
	//redPackageRouter := Router.Group("redPackage").Use(middleware.OperationRecord())
	redPackageRouterWithoutRecord := Router.Group("redPackage")
	var redPackageApi = v1.ApiGroupApp.AirDropApiGroup.RedPackageApi
	// {
	// 	redPackageRouter.POST("createRedPackage", redPackageApi.CreateRedPackage)             // 新建RedPackage
	// 	redPackageRouter.DELETE("deleteRedPackage", redPackageApi.DeleteRedPackage)           // 删除RedPackage
	// 	redPackageRouter.DELETE("deleteRedPackageByIds", redPackageApi.DeleteRedPackageByIds) // 批量删除RedPackage
	// 	redPackageRouter.PUT("updateRedPackage", redPackageApi.UpdateRedPackage)              // 更新RedPackage
	// }
	{
		redPackageRouterWithoutRecord.GET("findRedPackage", redPackageApi.FindRedPackage)       // 根据ID获取RedPackage
		redPackageRouterWithoutRecord.GET("getRedPackageList", redPackageApi.GetRedPackageWebList) // 获取RedPackage列表
		redPackageRouterWithoutRecord.GET("getRedPackageTxList", redPackageApi.GetRedPackageTxList) // 获取RedPackage列表
	}
}
