package router

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

// 无需认证的路由代码
func registerRecycleCardManageUnAuthRouter(v1 *gin.RouterGroup) {
	recycleCardRouter := v1.Group("/recycle_card")
	{
		recycleCardRouter.POST("order/detail", recyclecardmanage.RecycleCardOrderDetail)
		recycleCardRouter.POST("order/check", recyclecardmanage.RecycleCardOrderCheck)       // 管理端
		recycleCardRouter.POST("config/update", recyclecardmanage.RecycleCardConfigUpdate)   // 管理端
		recycleCardRouter.POST("config/info", recyclecardmanage.RecycleCardConfigInfo)       // 管理端
		recycleCardRouter.POST("order/retrieve", recyclecardmanage.RecycleCardOrderRetrieve) // 管理端
	}
}

// 需认证的路由代码
func registerRecycleCardManageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	recycleCardRouter := v1.Group("/recycle_card").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
	{
		recycleCardRouter.POST("cassette_image/update", recyclecardmanage.RecycleCardOrderImageUpdate) // 管理端
		recycleCardRouter.POST("order/list", recyclecardmanage.RecycleCardOrderList)
	}
}
