package router

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

// 无需认证的路由代码
func registerActivityManageUnAuthRouter(v1 *gin.RouterGroup) {
	activityRouter := v1.Group("/activity")

	redeemCode := activityRouter.Group("/redeem_code")
	{
		redeemCode.POST("/list", activitymanage.RedeemCodeList)
		//redeemCode.POST("/send_user", activity.RedeemCodeSendToUser)
		redeemCode.POST("/user_redeem_code/list", activitymanage.UserRedeemCodeList)
		redeemCode.POST("/user_coupon/list", activitymanage.UserCouponList)
		redeemCode.POST("/config", activitymanage.RenewalConfigInfo)
		redeemCode.POST("/config/update", activitymanage.RenewalConfigUpdate)
		redeemCode.POST("/statistic", activitymanage.UserMemberRenewalStatistic)
	}

}

// 需认证的路由代码
func registerActivityManageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	activityRouter := v1.Group("/activity").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
	{
		activityRouter.POST("/redeem_code/send_user", activitymanage.RedeemCodeSendToUser)
	}

}
