帮我编辑一个API用于获取数字化大屏开发中设备返回的信息
API名称:getDeviceInformation
功能描述:用于获取数字化大屏设备返回的信息,包括设备名称、型号、状态等。
请求方式:GET
请求URL:/api/devices/{deviceId}/information
请求参数:
| 参数名 | 类型 | 是否必须 | 描述 | | -------- | ------ | -------- | ------------------ | | deviceId | string | 是 | 设备ID,唯一标识符 |
响应参数:
| 参数名 | 类型 | 描述 | | ----------- | ------ | ---------------------------- | | deviceName | string | 设备名称 | | deviceModel | string | 设备型号 | | status | string | 设备状态,如在线、离线等 | | ipAddress | string | 设备IP地址 | | macAddress | string | 设备MAC地址 | | firmware | string | 设备固件版本号 | | serialNo | string | 设备序列号 | | cpuUsage | int | 设备CPU使用率,百分比表示 | | memoryUsage | int | 设备内存使用率,百分比表示 |
响应示例:
{
"deviceName": "数字化大屏设备",
"deviceModel": "Model A",
"status": "在线",
"ipAddress": "192.168.1.100",
"macAddress": "00:11:22:33:44:55",
"firmware": "V1.0.0",
"serialNo": "SN123456",
"cpuUsage": 50,
"memoryUsage": 70
}
错误码:
| 错误码 | 描述 | | ------ | ------------------ | | 400 | 请求参数错误 | | 401 | 用户未认证 | | 403 | 用户无权限访问 | | 404 | 设备不存在 | | 500 | 服务器内部错误
原文地址: https://www.cveoy.top/t/topic/e9aZ 著作权归作者所有。请勿转载和采集!