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
+16
View File
@@ -978,6 +978,22 @@
- 第二条记录历史或被幂等处理。
- 不重复扣费或重复变更最终状态。
### TC-GW-006 下游客户 CMPP 17890 入站 bind/submit
- 优先级:P0
- 前置条件:企业已认证通过;短信应用 active 且存在独立 6 位 `cmppAccount`;应用 IP 白名单包含测试客户端 IP;应用已有审核和报备通过的签名/模板;通道组、余额和 Gateway 均可用。
- 步骤:
1. 启动 Go Gateway,确认 `GATEWAY_CMPP_ADDR=0.0.0.0:17890`
2. 使用 gocmpp 或真实 CMPP 客户端连接 `17890``Source_Addr` 填应用 `cmppAccount`,密码填应用 CMPP 参数 `passwordCipher`
3. 发送 CMPP 3.0 SubmitReq,手机号和内容匹配已审核模板。
4. 查询 NestJS 数据库和运营端短信记录。
- 预期结果:
- 17890 是真实 CMPP Server 监听,不是 HTTP 端口。
- bind 阶段调用真实 NestJS API 校验账号、密码、企业状态、认证状态、应用状态和 IP 白名单。
- 密码错误、应用停用、企业停用、IP 不在白名单时 connect/login 被拒绝。
- submit 被接受后返回 CMPP SubmitResp 成功,并在真实数据库创建 `sourceType=cmpp` 的发送记录,进入真实发送链路。
- submit 内容不匹配审核模板、余额不足、无可用通道时返回明确失败,不得伪造成功。
### TC-SEND-021 优先队列插队发送
- 优先级:P0