agent-foundation/docs/ngp-performance-api.md

41 lines
1.1 KiB
Markdown
Raw Normal View History

2026-09-08 15:09:52 +08:00
# NGP 业绩合计接口
## 请求
`POST /api/ngp/performance/total`
```json
{
"startDate": "2026-09-01",
"endDate": "2026-09-06",
"storeName": "兰教练(抖店)"
}
```
- `startDate`、`endDate` 必填,包含首尾日期,最多 31 天。
- `storeName` 选填;不传或传空字符串时查询全部网点。多个网点可用逗号分隔。
- 系统状态和退款状态沿用 NGP 接口默认值。
- NGP 每页最多查询 200 条;服务会读取全部页面后返回合计。
## 响应
```json
{
"success": true,
"startDate": "2026-09-01",
"endDate": "2026-09-06",
"storeName": "全部网点",
"totalAmount": 4908668.47,
"formattedTotal": "4,908,668.47",
"currency": "CNY"
}
```
## 部署配置
NGP 的 AppKey、AppSecret、access token 和 refresh token 位于 `application.yml` 的
`foundation.ngp` 节点。access token 失效时服务会使用 refresh token 自动刷新,并在当前
进程内保存新 token。配置文件含明文凭据,只能保存在私有仓库并限制读取权限。
历史日期结果默认缓存 24 小时,包含今天的结果默认缓存 60 秒。