feat: add cmpp inbound gateway listener

This commit is contained in:
hectorzhao
2026-07-07 16:19:14 +08:00
parent ad3b86ba0a
commit cc628d0214
14 changed files with 631 additions and 17 deletions
+23
View File
@@ -583,6 +583,29 @@ npm run verify:phase8
- `verify:phase8` 当前失败点是独立 BullMQ 性能阈值,不是本轮通道组、计费、报备、回执业务逻辑测试失败。
- 浏览器端完整手工回归仍建议补跑企业应用创建、通道组配置、短信记录详情弹窗中的历史回执展示。
## 2026-07-07 Gateway 下游 CMPP 入站第一阶段补齐
### 本轮修复
- Go Gateway 启动时同时监听 `GATEWAY_CMPP_ADDR`,默认生产端口 `0.0.0.0:17890`,不再只是 HTTP `/health` 控制服务。
- 新增企业应用独立 6 位 `cmppAccount`Prisma 迁移 `20260707162000_add_application_cmpp_account` 会为存量应用生成账号;客户端/运营端 CMPP 参数接口返回该应用独立账号。
- Gateway 下游 CMPP bind 使用真实 gocmpp 协议解析 `Source_Addr/AuthSource/Timestamp`,调用 NestJS `/api/gateway/events/inbound/authenticate`,由真实数据库校验应用账号、应用 CMPP 密码、企业状态、企业认证状态、应用状态和 IP 白名单。
- Gateway 下游 CMPP submit 解码 CMPP 3.0 `SubmitReq`,调用 NestJS `/api/gateway/events/inbound/submit`NestJS 按 `sourceType=cmpp` 创建发送记录并复用模板/签名/风控/余额/运营商识别/通道组路由/队列优先级链路。
- Go Gateway 新增入站集成测试,覆盖本地 CMPP 客户端 connect/login、UCS2 submit 和 API 回调。
### 验证状态
- `npm --prefix api run prisma:generate`:通过。
- `npm --prefix api test -- sms-config.service.spec.ts send-chain.service.spec.ts --runInBand`:通过。
- `npm --prefix api run build`:通过。
- `go test ./...`Gateway):通过。
### 剩余缺口
- 下游连接状态回写、连接数上限、断开/心跳历史日志仍需继续产品化。
- 下游 submit 当前通过 `sourceType=cmpp` 的系统批次兼容承载,尚未完全拆成独立单条发送模型。
- 客户侧最终 Deliver Receipt 投递、客户侧上行 Deliver 推送、上游真实 SMSC submit worker、上游 receipt/uplink 生产解析仍未完成。
## 2026-07-03 阶段 9:运营端报备回执导入真实上传/解析
### 本轮修复