Files
junhong_cmp_fiber/internal/routes/card_realname.go
邹进 4967f4df43
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
feat: 卡实名时间以上游 archiveTime 为准并记录实名时间历史,新增二次实名批次
2026-11-08 19:12:46 +09:00

39 lines
2.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 registerCardRealnameRoutes(router fiber.Router, handler *admin.CardRealnameHandler, doc *openapi.Generator, basePath string) {
tags := []string{"卡实名记录"}
Register(router, doc, basePath, "GET", "/iot-cards/:id/realname-history", handler.CardHistory, RouteSpec{
Summary: "查询单卡实名时间与历史",
Description: "current 为当前实名时间:上游返回 archiveTime 时以它为准(来源 upstream),否则为首次读到已实名的时间(first_observed)," +
"上线前已实名的卡沿用库里时间(migrated)。历史只在实名时间变化时记录,按时间倒序分页。卡按当前账号数据范围可见。",
Tags: tags, Input: new(dto.CardRealnameHistoryListRequest), Output: new(dto.CardRealnameHistoryResponse), Auth: true,
})
Register(router, doc, basePath, "POST", "/realname-reset/batches", handler.ImportResetBatch, RouteSpec{
Summary: "导入二次实名名单",
Description: "仅平台账号,需 iot_card:realname_reset 权限。资产号为 ICCID / 虚拟号 / IMEI,设备展开为其全部绑定卡,最多 1000 个。" +
"逐卡清除实名状态与实名时间;未实名、上游从未返回 archiveTime、已在等待的卡跳过并写明原因,不影响其他行。" +
"之后上游 archiveTime 晚于清除前时间才算二次实名完成。C 端按普通未实名展示。",
Tags: tags, Input: new(dto.RealnameResetImportRequest), Output: new(dto.RealnameResetBatchResponse), Auth: true,
})
Register(router, doc, basePath, "GET", "/realname-reset/batches", handler.ListResetBatches, RouteSpec{
Summary: "二次实名批次列表", Description: "仅平台账号,按导入时间倒序分页。",
Tags: tags, Input: new(dto.RealnameResetBatchListRequest), Output: new(dto.RealnameResetBatchResponse), Auth: true,
})
Register(router, doc, basePath, "GET", "/realname-reset/batches/:id", handler.GetResetBatch, RouteSpec{
Summary: "二次实名批次详情", Description: "仅平台账号;逐行结果按卡当前状态显示等待二次实名 / 已完成 / 已撤销 / 跳过 / 失败。",
Tags: tags, Input: new(dto.RealnameResetBatchIDRequest), Output: new(dto.RealnameResetBatchResponse), Auth: true,
})
Register(router, doc, basePath, "POST", "/realname-reset/batches/:id/revert", handler.RevertResetBatch, RouteSpec{
Summary: "撤销二次实名", Description: "仅平台账号,需 iot_card:realname_reset 权限。card_ids 为空时撤销整批仍在等待的卡;卡恢复已实名、实名时间恢复为清除前时间。",
Tags: tags, Input: new(dto.RealnameResetRevertRequest), Output: new(dto.RealnameResetRevertResponse), Auth: true,
})
}