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 registerIotCardRoutes(router fiber.Router, handler *admin.IotCardHandler, importHandler *admin.IotCardImportHandler, doc *openapi.Generator, basePath string) { iotCards := router.Group("/iot-cards") groupPath := basePath + "/iot-cards" Register(iotCards, doc, groupPath, "GET", "/standalone", handler.ListStandalone, RouteSpec{ Summary: "单卡列表(未绑定设备)", Tags: []string{"IoT卡管理"}, Input: new(dto.ListStandaloneIotCardRequest), Output: new(dto.ListStandaloneIotCardResponse), Auth: true, }) Register(iotCards, doc, groupPath, "POST", "/import", importHandler.Import, RouteSpec{ Summary: "批量导入ICCID", Tags: []string{"IoT卡管理"}, Input: new(dto.ImportIotCardRequest), Output: new(dto.ImportIotCardResponse), Auth: true, }) Register(iotCards, doc, groupPath, "GET", "/import-tasks", importHandler.List, RouteSpec{ Summary: "导入任务列表", Tags: []string{"IoT卡管理"}, Input: new(dto.ListImportTaskRequest), Output: new(dto.ListImportTaskResponse), Auth: true, }) Register(iotCards, doc, groupPath, "GET", "/import-tasks/:id", importHandler.GetByID, RouteSpec{ Summary: "导入任务详情", Tags: []string{"IoT卡管理"}, Input: new(dto.GetImportTaskRequest), Output: new(dto.ImportTaskDetailResponse), Auth: true, }) }