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" ) // registerPackageExpiryRoutes 注册后台和代理共用的临期资产查询路由。 func registerPackageExpiryRoutes(router fiber.Router, handler *admin.AssetHandler, doc *openapi.Generator, basePath string) { Register(router, doc, basePath, "GET", "/expiring-assets", handler.ListExpiring, RouteSpec{ Summary: "查询临期资产列表", Description: "分页返回当前账号店铺权限范围内剩余 0 至 15 个上海自然日的卡和设备,并提供卡、设备数量、高亮等级及 0 至 3 天优先标识。企业账号禁止调用。", Tags: []string{"资产管理"}, Input: new(dto.ExpiringAssetListRequest), Output: new(dto.ExpiringAssetListResponse), Auth: true, }) Register(router, doc, basePath, "POST", "/expiring-assets/export", handler.ExportExpiring, RouteSpec{ Summary: "创建临期资产导出任务", Description: "受控导出入口:请求体复用临期资产列表的筛选集合(时间区间、剩余天数上下限、套餐、资产类型、关键字、店铺),创建时冻结筛选、时间边界、操作者与可见店铺范围。导出一行对应一项资产,取当前生效主套餐最终到期时间与剩余天数,加油包不单独成行;列序为店铺、业务员、用户组、资产类型、设备类型、设备型号、资产标识、当前套餐、到期时间、剩余天数。企业账号禁止调用。", Tags: []string{"资产管理"}, Input: new(dto.ExportExpiringAssetRequest), Output: new(dto.CreateExportTaskResponse), Auth: true, }) Register(router, doc, basePath, "POST", "/expiring-assets/reminder-scan", handler.TriggerPackageExpiryReminder, RouteSpec{ Summary: "手动触发每日临期提醒扫描", Description: "仅超级管理员可调用。立即提交与每日 03:00 相同的每日临期提醒扫描任务:扫描最终到期时间可精确推算且剩余 0 至 15 个上海自然日的资产;粉色(8 至 15 天)、紫色(4 至 7 天)、红色(0 至 3 天)仅表示列表展示等级。任务异步执行并沿用通知防重,不生成临期列表快照。", Tags: []string{"资产管理"}, Output: new(dto.TriggerPackageExpiryReminderResponse), Auth: true, }) }