该接口支持根据 ID 删除设备。
请求接口
DELETE /api/device/instance/{id}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| id | path | string | 是 | 设备ID |
| X-Access-Token | header | string | 是 | 平台 token |
| body | body | object | 否 | - |
响应参数
以200 Response为例,响应参数如下:
| 名称 | 类型 | 必选 | 约束 | 说明 |
|---|---|---|---|---|
| » message | string | true | none | 返回信息 |
| » result | object | true | none | 返回结果 |
| »» id | string | true | none | 设备ID |
| »» name | string | true | none | 设备名称 |
| »» deviceType | object | true | none | 设备类型 |
| »»» text | string | true | none | 内容 |
| »»» value | string | true | none | 值 |
| »» photoUrl | string | true | none | 设备图片URL |
| »» productId | string | true | none | 产品ID |
| »» productName | string | true | none | 产品名称 |
| »» state | object | true | none | 状态 |
| »»» text | string | true | none | 内容 |
| »»» value | string | true | none | 值 |
| »» edge | boolean | true | none | 是否为边缘设备 |
| »» superDeviceType | object | true | none | 超级设备类型 |
| »»» text | string | true | none | 内容 |
| »»» value | string | true | none | 值 |
| »» creatorId | string | true | none | 创建者ID |
| »» createTime | integer | true | none | 创建时间 |
| »» createName | string | true | none | 创建者姓名 |
| »» registryTime | integer | true | none | 注册时间 |
| »» features | [array] | true | none | 设备特性 |
| »» virtualType | object | true | none | 虚拟设备类型:真实设备、虚拟设备 |
| »»» text | string | true | none | 内容 |
| »»» value | string | true | none | 值 |
| »» regulator | boolean | true | none | 是否为控制器 |
| »» comeFrom | object | true | none | 设备来源:云生成、端生成 |
| »»» text | string | true | none | 内容 |
| »»» value | string | true | none | 值 |
| »» deviceCreateType | object | true | none | 设备新增类型 |
| »»» text | string | true | none | 内容 |
| »»» value | string | true | none | 值 |
| »» modifierId | string | true | none | 修改者ID |
| »» modifyTime | integer | true | none | 修改时间 |
| »» modifyName | string | true | none | 修改者姓名 |
| » status | integer | true | none | 状态码 |
| » timestamp | integer | true | none | 时间戳 |
| »» presetType | object | true | none | 类型 |
| »»» text | string | true | none | 内容 |
| »»» value | string | true | none | 值 |
| »» categoryType | object | true | none | 分类类型 |
| »»» text | string | true | none | 内容 |
| »»» value | string | true | none | 值 |
| »» mediaDevice | boolean | true | none | 媒体设备 |
| » status | integer | true | none | 响应状态码 |
| » timestamp | integer | true | none | 时间戳 |
响应状态码
| 状态码 | 状态码含义 | 说明 |
|---|---|---|
| 200 | OK | 成功 |
| 401 | Unauthorized | 登录状态已过期,token不能为空 |
| 500 | Internal Server Error | 服务器内部异常 |
Body 示例
json
{}{}返回示例
以200 Response为例:
json
{
"message": "success",
"result": {
"id": "qqqqq",
"photoUrl": "/images/card/product.png",
"name": "qqqqqqqqqqqq",
"deviceType": {
"text": "直连设备",
"value": "device"
},
"productId": "1684866341890375680",
"productName": "455",
"state": {
"text": "在线",
"value": "online"
},
"edge": false,
"superDeviceType": {
"text": "普通设备",
"value": "normalDevice"
},
"creatorId": "1199596756811550720",
"creatorName": "\t\r\n室内安防",
"createTime": 1690870549840,
"registryTime": 1690870549862,
"features": [],
"virtualType": {
"text": "真实设备",
"value": "real"
},
"regulator": false,
"comeFrom": {
"text": "云生成",
"value": "cloud"
},
"deviceCreateType": {
"text": "根据产品(超级设备模型)生成",
"value": "fromProduct"
},
"modifyTime": 1690870549840,
"modifierId": "1199596756811550720",
"modifierName": "\t\r\n室内安防",
"presetType": {
"text": "非内置",
"value": "none"
},
"categoryType": {
"text": "默认类型",
"value": "none"
},
"mediaDevice": false
},
"status": 200,
"timestamp": 1690870553625
}{
"message": "success",
"result": {
"id": "qqqqq",
"photoUrl": "/images/card/product.png",
"name": "qqqqqqqqqqqq",
"deviceType": {
"text": "直连设备",
"value": "device"
},
"productId": "1684866341890375680",
"productName": "455",
"state": {
"text": "在线",
"value": "online"
},
"edge": false,
"superDeviceType": {
"text": "普通设备",
"value": "normalDevice"
},
"creatorId": "1199596756811550720",
"creatorName": "\t\r\n室内安防",
"createTime": 1690870549840,
"registryTime": 1690870549862,
"features": [],
"virtualType": {
"text": "真实设备",
"value": "real"
},
"regulator": false,
"comeFrom": {
"text": "云生成",
"value": "cloud"
},
"deviceCreateType": {
"text": "根据产品(超级设备模型)生成",
"value": "fromProduct"
},
"modifyTime": 1690870549840,
"modifierId": "1199596756811550720",
"modifierName": "\t\r\n室内安防",
"presetType": {
"text": "非内置",
"value": "none"
},
"categoryType": {
"text": "默认类型",
"value": "none"
},
"mediaDevice": false
},
"status": 200,
"timestamp": 1690870553625
}