package router

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

func registerMarketingManageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	r := v1.Group("/marketing").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())

	r.POST("coupon/list", market.ErpMarketingCouponList)     // 优惠券列表
	r.POST("coupon/create", market.ErpMarketingCouponCreate) // 新增优惠券
	r.POST("coupon/edit", market.ErpMarketingCouponEdit)     // 编辑优惠券
	r.POST("coupon/detail", market.ErpMarketingCouponDetail) // 优惠券详情
	r.POST("coupon/delete", market.ErpMarketingCouponDelete) // 删除优惠券
	r.POST("coupon/start", market.ErpMarketingCouponStart)   // 启动优惠券发放
	r.POST("coupon/data", market.ErpMarketingCouponData)     // 优惠券数据
}

func registerMarketingManageUnAuthRouter(v1 *gin.RouterGroup) {
	r := v1.Group("/marketing")

	r.POST("generateScheme", market.GenerateScheme) // 获取小程序跳转链接
}
