Files
gt-agent-company/docs/停复机.md
2026-05-08 14:54:36 +08:00

427 lines
6.3 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.
# 设备停机
## 接口信息
- **页面**/asset-management/device-stop
- **按钮名称**:停机
- **权限编码**asset_device_stop
---
## URL
`POST /api/admin/assets/device/{device_id}/stop`
---
## 请求参数
### Path 参数
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| device_id | integer | 是 | 设备ID |
### Body 参数application/json
无请求体参数
---
## 响应说明
### Response 字段
| 字段 | 类型 | 说明 |
|------|------|------|
| code | integer | 响应码 |
| msg | string | 响应消息 |
| timestamp | string | 时间戳 |
| data | object | 返回数据 |
---
## data 字段(设备停机响应对象)
| 字段 | 类型 | 说明 |
|------|------|------|
| success_count | integer | 成功停机卡数 |
| fail_count | integer | 失败卡数 |
| skip_count | integer | 跳过卡数(未实名或已停机) |
| failed_items | array | 失败详情 |
---
## failed_items 字段(设备停机失败项对象)
| 字段 | 类型 | 说明 |
|------|------|------|
| iccid | string | 卡ICCID |
| reason | string | 失败原因 |
---
## 错误响应
| HTTP 状态码 | 说明 |
|------------|------|
| 400 | 请求参数错误 |
| 401 | 未认证或认证已过期 |
| 403 | 无权访问 |
| 500 | 服务器内部错误 |
---
## 请求示例
```
POST /api/admin/assets/device/12345/stop
```
---
## 响应示例
```json
{
"code": 0,
"msg": "success",
"timestamp": "2024-03-30T10:30:00Z",
"data": {
"success_count": 48,
"fail_count": 2,
"skip_count": 5,
"failed_items": [
{
"iccid": "8986001234567890123",
"reason": "网络连接失败"
},
{
"iccid": "8986001234567890124",
"reason": "设备状态异常"
}
]
}
}
```
---
## 使用说明
- **功能**:批量停机设备下所有已实名卡
- **保护期**设置1小时停机保护期
- **影响范围**:仅对已实名卡生效,未实名或已停机的卡会被跳过
- **返回结果**:详细统计停机成功、失败和跳过的卡数,以及失败原因
---
## 认证
- **认证方式**Bearer Token (JWT)
- **Header**`Authorization: Bearer <token>`
---
## API 分类
- **模块**:资产管理
- **状态**:已发布
---
## 服务器地址
- **测试环境**https://cmp-api.xm-iot.cn
# 设备复机
## 接口信息
- **页面**/asset-management/device
- **按钮名称**:设备复机
- **权限编码**asset_device_start
---
## URL
`POST /api/admin/assets/device/{device_id}/start`
---
## 请求参数
### Path 参数
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| device_id | integer | 是 | 设备ID |
### Body 参数
无请求 Body 参数
---
## 响应说明
### Response 字段
| 字段 | 类型 | 说明 |
|------|------|------|
| code | integer | 响应码 |
| msg | string | 响应消息 |
| timestamp | string | 时间戳 |
| data | object | 返回数据 |
---
## 错误响应
| HTTP 状态码 | 说明 |
|------------|------|
| 400 | 请求参数错误 |
| 401 | 未认证或认证已过期 |
| 403 | 无权访问 |
| 500 | 服务器内部错误 |
---
## 请求示例
```
POST /api/admin/assets/device/12345/start
```
---
## 响应示例
```json
{
"code": 0,
"msg": "success",
"timestamp": "2024-03-30T10:30:00Z",
"data": null
}
```
---
## 功能说明
- **复机对象**:批量复机设备下所有已实名卡
- **保护期**设置1小时复机保护期
---
## 认证
- **认证方式**Bearer Token (JWT)
- **Header**`Authorization: Bearer <token>`
---
## API 分类
- **模块**:资产管理
- **状态**:已发布
---
## 服务器地址
- **测试环境**https://cmp-api.xm-iot.cn
# 单卡停机
## 接口信息
- **页面**/asset-management/card
- **按钮名称**:单卡停机
- **权限编码**asset_card_stop
---
## URL
`POST /api/admin/assets/card/{iccid}/stop`
---
## 请求参数
### Path 参数
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| iccid | string | 是 | 卡ICCID |
### Body 参数
无请求 Body 参数
---
## 响应说明
### Response 字段
| 字段 | 类型 | 说明 |
|------|------|------|
| code | integer | 响应码 |
| msg | string | 响应消息 |
| timestamp | string | 时间戳 |
| data | object | 返回数据 |
---
## 错误响应
| HTTP 状态码 | 说明 |
|------------|------|
| 400 | 请求参数错误 |
| 401 | 未认证或认证已过期 |
| 403 | 无权访问 |
| 500 | 服务器内部错误 |
---
## 请求示例
```
POST /api/admin/assets/card/89860123456789012345/stop
```
---
## 响应示例
```json
{
"code": 0,
"msg": "success",
"timestamp": "2024-03-30T10:30:00Z",
"data": null
}
```
---
## 功能说明
- **操作对象**手动停机单张卡通过ICCID
- **约束条件**:受设备保护期约束
---
## 认证
- **认证方式**Bearer Token (JWT)
- **Header**`Authorization: Bearer <token>`
---
## API 分类
- **模块**:资产管理
- **状态**:已发布
---
## 服务器地址
- **测试环境**https://cmp-api.xm-iot.cn
# 单卡复机
## 接口信息
- **页面**/asset-management/card
- **按钮名称**:单卡复机
- **权限编码**asset_card_start
---
## URL
`POST /api/admin/assets/card/{iccid}/start`
---
## 请求参数
### Path 参数
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| iccid | string | 是 | 卡ICCID |
---
## 响应说明
### Response 字段
| 字段 | 类型 | 说明 |
|------|------|------|
| code | integer | 响应码 |
| msg | string | 响应消息 |
| timestamp | string | 时间戳 |
| data | object | 返回数据 |
---
## 错误响应
| HTTP 状态码 | 说明 |
|------------|------|
| 400 | 请求参数错误 |
| 401 | 未认证或认证已过期 |
| 403 | 无权访问 |
| 500 | 服务器内部错误 |
---
## 请求示例
```
POST /api/admin/assets/card/89860123456789012345/start
```
---
## 响应示例
```json
{
"code": 0,
"msg": "success",
"timestamp": "2024-03-30T10:30:00Z",
"data": {
"iccid": "89860123456789012345",
"status": "active"
}
}
```
---
## 认证
- **认证方式**Bearer Token (JWT)
- **Header**`Authorization: Bearer <token>`
---
## API 分类
- **模块**:资产管理
- **状态**:已发布
---
## 服务器地址
- **测试环境**https://cmp-api.xm-iot.cn