57 lines
2.5 KiB
Markdown
57 lines
2.5 KiB
Markdown
# Change: Add IoT Card and Device Operations
|
||
|
||
## Why
|
||
|
||
运营人员和代理商需要更丰富的物联网卡和设备管理功能,包括查询流量使用情况、实名认证状态、卡片状态、启停操作,以及设备的重启、重置、限速、换卡、WiFi设置等操作。这些功能是物联网卡全生命周期管理的核心能力。
|
||
|
||
## What Changes
|
||
|
||
### IoT Card Operations (6 new APIs)
|
||
- 查询流量使用情况 (GET /api/admin/iot-cards/{iccid}/gateway-flow)
|
||
- 查询实名认证状态 (GET /api/admin/iot-cards/{iccid}/gateway-realname)
|
||
- 查询卡片状态 (GET /api/admin/iot-cards/{iccid}/gateway-status)
|
||
- 获取实名认证链接 (GET /api/admin/iot-cards/{iccid}/realname-link)
|
||
- 启用物联网卡 (POST /api/admin/iot-cards/{iccid}/start)
|
||
- 停用物联网卡 (POST /api/admin/iot-cards/{iccid}/stop)
|
||
|
||
### Device Operations (6 new APIs)
|
||
- 重启设备 (POST /api/admin/devices/by-imei/{imei}/reboot)
|
||
- 重置设备 (POST /api/admin/devices/by-imei/{imei}/reset)
|
||
- 设置限速 (PUT /api/admin/devices/by-imei/{imei}/speed-limit)
|
||
- 切换SIM卡 (POST /api/admin/devices/by-imei/{imei}/switch-card)
|
||
- 设置WiFi (PUT /api/admin/devices/by-imei/{imei}/wifi)
|
||
|
||
### UI Changes
|
||
- 在 `/asset-management/iot-card-management` 页面添加操作按钮:
|
||
- "查询流量"按钮(主要操作)
|
||
- "更多操作"下拉菜单(包含其他5个操作)
|
||
- 在 `/asset-management/devices` 页面添加操作按钮:
|
||
- "重启设备"按钮(主要操作)
|
||
- "更多操作"下拉菜单(包含其他5个操作)
|
||
|
||
## Impact
|
||
|
||
### Affected Specs
|
||
- **NEW**: `specs/iot-card-operations/spec.md` - IoT卡操作相关的所有需求
|
||
- **NEW**: `specs/device-operations/spec.md` - 设备操作相关的所有需求
|
||
|
||
### Affected Code
|
||
- **API层**:
|
||
- 新增 `src/api/modules/iotCard.ts` - IoT卡操作API方法
|
||
- 新增 `src/api/modules/device.ts` - 设备操作API方法
|
||
- **类型定义**:
|
||
- 新增 `src/types/api/iotCard.ts` - IoT卡相关类型
|
||
- 新增 `src/types/api/device.ts` - 设备相关类型
|
||
- **页面组件**:
|
||
- 修改 `src/views/asset-management/iot-card-management/index.vue` - 添加操作按钮和对话框
|
||
- 修改 `src/views/asset-management/devices/index.vue` - 添加操作按钮和对话框
|
||
|
||
### Breaking Changes
|
||
无破坏性变更。所有变更都是增量式的新功能添加。
|
||
|
||
## Dependencies
|
||
|
||
- 后端API已实现(见 `docs/2-3新增接口.md`)
|
||
- Element Plus UI组件库(已在项目中)
|
||
- Axios HTTP客户端(已在项目中)
|