package routes import ( "github.com/gofiber/fiber/v2" "github.com/break/junhong_cmp_fiber/internal/handler/admin" "github.com/break/junhong_cmp_fiber/internal/model/dto" "github.com/break/junhong_cmp_fiber/pkg/openapi" ) func registerEnterpriseCardRoutes(router fiber.Router, handler *admin.EnterpriseCardHandler, doc *openapi.Generator, basePath string) { enterprises := router.Group("/enterprises") groupPath := basePath + "/enterprises" Register(enterprises, doc, groupPath, "POST", "/:id/allocate-cards/preview", handler.AllocateCardsPreview, RouteSpec{ Summary: "卡授权预检", Tags: []string{"企业卡授权"}, Input: new(dto.AllocateCardsPreviewReq), Output: new(dto.AllocateCardsPreviewResp), Auth: true, }) Register(enterprises, doc, groupPath, "POST", "/:id/allocate-cards", handler.AllocateCards, RouteSpec{ Summary: "授权卡给企业", Tags: []string{"企业卡授权"}, Input: new(dto.AllocateCardsReq), Output: new(dto.AllocateCardsResp), Auth: true, }) Register(enterprises, doc, groupPath, "POST", "/:id/recall-cards", handler.RecallCards, RouteSpec{ Summary: "回收卡授权", Tags: []string{"企业卡授权"}, Input: new(dto.RecallCardsReq), Output: new(dto.RecallCardsResp), Auth: true, }) Register(enterprises, doc, groupPath, "GET", "/:id/cards", handler.ListCards, RouteSpec{ Summary: "企业卡列表", Tags: []string{"企业卡授权"}, Input: new(dto.EnterpriseCardListReq), Output: new(dto.EnterpriseCardPageResult), Auth: true, }) Register(enterprises, doc, groupPath, "POST", "/:id/cards/:card_id/suspend", handler.SuspendCard, RouteSpec{ Summary: "停机卡", Tags: []string{"企业卡授权"}, Input: new(dto.SuspendCardReq), Output: nil, Auth: true, }) Register(enterprises, doc, groupPath, "POST", "/:id/cards/:card_id/resume", handler.ResumeCard, RouteSpec{ Summary: "复机卡", Tags: []string{"企业卡授权"}, Input: new(dto.ResumeCardReq), Output: nil, Auth: true, }) }