Files
junhong_cmp_fiber/openspec/specs/agent-open-api/spec.md

36 lines
1.7 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.
# agent-open-api 当前行为
## Purpose
描述代理开放接口认证与店铺数据范围的当前行为。
## Requirements
### Requirement: 开放接口认证
系统 SHALL 在代理开放接口执行业务前校验调用方身份与请求签名。
#### Scenario: 开放接口认证
- **GIVEN** 请求缺少、伪造或过期的认证材料
- **WHEN** 调用任一代理开放接口
- **THEN** 请求被拒绝且不执行资源或资金变化
### Requirement: 开放接口数据范围
系统 SHALL 仅允许代理访问其店铺数据范围内的卡、套餐和钱包。
#### Scenario: 开放接口数据范围
- **GIVEN** 代理请求其他店铺资源
- **WHEN** 查询或写入
- **THEN** 请求被统一拒绝且不泄露资源存在性
## 可达操作索引
本节只用于入口导航,不是行为 Requirement业务义务以上述 Requirements 为准。
### 代理开放接口
`GET /api/open/v1/cards/realname-status`(查询单卡实名状态);`POST /api/open/v1/cards/resume`(机卡分离卡复机);`GET /api/open/v1/cards/status`(查询单卡状态);`GET /api/open/v1/cards/traffic`(查询单卡或设备流量);`POST /api/open/v1/devices/reboot`(重启设备);`POST /api/open/v1/devices/reset`(恢复出厂设置);`POST /api/open/v1/devices/switch-card`(切网(多卡设备切换 ICCID`GET /api/open/v1/devices/traffic`(查询设备套餐内流量);`GET /api/open/v1/packages`(查询套餐列表);`GET /api/open/v1/wallet/balance`(查询预充值钱包余额);`POST /api/open/v1/wallet/package-orders`(钱包套餐购买);`GET /api/open/v1/wallet/transactions`(查询预充值钱包流水)。