feat: 卡流量改为日快照计量并统一停复机规则
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled

卡流量计量(按名单灰度,默认 off):
- 新增卡日快照与切换水位表(000241),按通道上游流量重置日换算自然月、重置日防旧值
- 已切换的卡按月对账产生增量,无生效中套餐只结算不发事件;第一次切换写水位
- 已切换卡读数有效即判定通道阈值,卡表本月用量用快照覆盖,日流量读快照
- 配置 JUNHONG_TRAFFIC_CALC_MODE/CARDS、JUNHONG_TRAFFIC_FLOW_SNAPSHOT_ENABLED

停复机规则(总开关 JUNHONG_STOP_RESUME_UNIFIED_RULE_ENABLED,默认关闭):
- 复机不看停机原因,持通道阈值锁仍拒绝;暂停轮询的卡不自动停复机
- 通道新增实名管控 realname_control_enabled(000242,默认 0),开启后不区分行业卡与实名策略
- 实名管控从 0 改 1 需确认,修改并入通道更新审计

OpenSpec Change: rebuild-card-traffic-metering-and-stop-resume
This commit is contained in:
邹进
2026-10-20 17:49:26 +09:00
parent 44a05cf687
commit 96771a204f
37 changed files with 1859 additions and 98 deletions

View File

@@ -70,10 +70,13 @@ func registerCarrierRoutes(router fiber.Router, handler *admin.CarrierHandler, d
Register(carriers, doc, groupPath, "PUT", "/:id", handler.Update, RouteSpec{
Summary: "更新运营商",
Tags: []string{"运营商管理"},
Input: new(dto.UpdateCarrierParams),
Output: new(dto.CarrierResponse),
Auth: true,
Description: "通道流量阈值与通道实名管控(realname_control_enabled)仅超级管理员与平台账号可修改,非平台账号携带即整体拒绝;" +
"实名管控从 0 改为 1 时必须携带 realname_control_confirm=true,未确认时返回该通道未实名开机卡数且不保存;" +
"修改并入运营商更新审计",
Tags: []string{"运营商管理"},
Input: new(dto.UpdateCarrierParams),
Output: new(dto.CarrierResponse),
Auth: true,
})
Register(carriers, doc, groupPath, "DELETE", "/:id", handler.Delete, RouteSpec{