Files
iotlcm/README.MD
T
2026-10-29 14:59:32 +08:00

41 lines
1.4 KiB
Markdown
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.
# iotlcm-upstream-chan
配置示例见 `build/config.example.yaml` 与 `config/config.example.yaml`。请使用获授权的测试卡。
## 本地测试
```
curl -d '{"simKeys":[
{"chanKey":"channel_003",
"iccid":"89860000000000000003",
"imsi":"",
"msisdn":""}
], "reqData":{"yearMonth":"202602"}}' 127.0.0.1:8110/sim/query/sim-datausage-monthly
curl -d '{"simKeys":[
{"chanKey":"channel_003",
"iccid":"89860000000000000003",
"imsi":"",
"msisdn":""}
], "reqData":{"queryDate":"20260201"}}' 127.0.0.1:8110/sim/query/sim-datausage-daily
```
### 异步全量消费者直调约定
本月实时累计用量全量同步使用 `POST /sim/query/sim-datausage`,不经过 Proxy。消费者从卡信息表取得 `chanKey` 和三码后直接发送:
```json
{
"simKeys": [
{
"chanKey": "channel_003",
"iccid": "89860000000000000003",
"imsi": "",
"msisdn": "1440000000003"
}
],
"reqData": {}
}
```
一条请求应只包含同一个 `chanKey` 的卡。响应由 GoFrame 统一包装为 `{code,message,data}`;`data` 按输入卡逐项返回,单项 `code=0` 表示成功,通道或网络等本地错误使用 `9999`,运营商返回的业务错误码原样保留。`data[].resData.dataUsage` 已统一为 MB。该接口查询调用时的当前月份,不使用 `queryDate`;需要指定历史月份时使用独立的月查询接口。