该接口支持根据ID查询产品详情。
请求接口
GET /api/device-product/{id}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | path | string | 是 | 产品唯一标识ID |
X-Access-Token | header | string | 是 | 平台token |
响应参数
以200 Response为例,响应参数如下:
名称 | 类型 | 必选 | 约束 | 中文名 |
---|---|---|---|---|
» message | string | true | none | 返回信息 |
» result | object | true | none | 返回结果 |
»» id | string | true | none | 产品ID |
»» name | string | true | none | 产品名称 |
»» photoUrl | string | true | none | 产品图标URL |
»» classifiedId | string | true | none | 产品分类ID |
»» classifiedName | string | true | none | 产品分类名称 |
»» messageProtocol | string | true | none | 产品协议包ID |
»» protocolName | string | true | none | 产品协议包名称 |
»» metadata | string | true | none | 产品物模型 |
»» transportProtocol | string | true | none | 连接协议 |
»» deviceType | object | true | none | 设备类型 |
»»» text | string | true | none | 设备类型名称 |
»»» value | string | true | none | 设备类型标识 |
»» configuration | object | true | none | 协议配置信息 |
»» state | integer | true | none | 产品当前状态 |
»» creatorId | string | true | none | 创建者ID |
»» createTime | integer | true | none | 创建时间 |
»» accessId | string | true | none | 接入网关ID |
»» accessProvider | string | true | none | 接入服务 |
»» accessName | string | true | none | 接入网关名称 |
»» storePolicy | string | true | none | 数据存储策略 |
»» modifierId | string | true | none | 修改者ID |
»» modifyTime | integer | true | none | 修改时间 |
» status | integer | true | none | 响应状态码 |
» timestamp | integer | true | none | 时间戳 |
响应状态码
状态码 | 状态码含义 | 说明 |
---|---|---|
200 | OK | 成功 |
401 | Unauthorized | 登录状态已过期,token不能为空 |
500 | Internal Server Error | 服务器内部异常 |
返回示例
以200 Response为例:
json
{
"message": "success",
"result": {
"id": "waitdelete",
"name": "待删除",
"photoUrl": "/images/card/product.png",
"classifiedId": "-12-",
"classifiedName": "其他场景",
"messageProtocol": "d79e86511a67fc42fc0683a3917de033",
"protocolName": "内置协议",
"metadata": "{\"events\":[{\"expands\":{\"level\":\"ordinary\"},\"valueType\":{\"type\":\"object\",\"expands\":{},\"properties\":[{\"valueType\":{\"expands\":{},\"type\":\"int\"},\"id\":\"1\",\"name\":\"1\"}]},\"id\":\"11\",\"name\":\"11\",\"sortsIndex\":0}],\"properties\":[{\"valueType\":{\"type\":\"int\",\"expands\":{},\"unit\":\"count\"},\"expands\":{\"source\":\"device\",\"type\":[\"read\",\"write\",\"report\"],\"metrics\":[]},\"id\":\"a\",\"name\":\"a\",\"sortsIndex\":0},{\"valueType\":{\"type\":\"string\",\"expands\":{}},\"expands\":{\"source\":\"device\",\"type\":[\"write\",\"read\",\"report\"],\"metrics\":[]},\"id\":\"b\",\"name\":\"b\",\"sortsIndex\":1}]}",
"transportProtocol": "MQTT",
"deviceType": {
"text": "网关设备",
"value": "gateway"
},
"configuration": {
"secureId": "waitdelete",
"secureKey": "****************"
},
"state": 1,
"creatorId": "1199596756811550720",
"createTime": 1695376779513,
"regulator": false,
"accessId": "6b194cc8d70376c3dfc623b47aacb558",
"accessProvider": "child-device",
"accessName": "内置MQTT子设备接入网关",
"superProductType": {
"text": "普通产品",
"value": "commonProduct"
},
"virtualType": {
"text": "真实设备",
"value": "real"
},
"productCreateType": {
"text": "手动",
"value": "manual"
},
"modifierId": "1199596756811550720",
"modifyTime": 1695376779513,
"threeDimensionalUrl": "/images/card/product.png",
"deviceNum": 1,
"modelFrom": "自定义",
"presetType": {
"text": "非内置",
"value": "none"
}
},
"status": 200,
"timestamp": 1695621631935
}
{
"message": "success",
"result": {
"id": "waitdelete",
"name": "待删除",
"photoUrl": "/images/card/product.png",
"classifiedId": "-12-",
"classifiedName": "其他场景",
"messageProtocol": "d79e86511a67fc42fc0683a3917de033",
"protocolName": "内置协议",
"metadata": "{\"events\":[{\"expands\":{\"level\":\"ordinary\"},\"valueType\":{\"type\":\"object\",\"expands\":{},\"properties\":[{\"valueType\":{\"expands\":{},\"type\":\"int\"},\"id\":\"1\",\"name\":\"1\"}]},\"id\":\"11\",\"name\":\"11\",\"sortsIndex\":0}],\"properties\":[{\"valueType\":{\"type\":\"int\",\"expands\":{},\"unit\":\"count\"},\"expands\":{\"source\":\"device\",\"type\":[\"read\",\"write\",\"report\"],\"metrics\":[]},\"id\":\"a\",\"name\":\"a\",\"sortsIndex\":0},{\"valueType\":{\"type\":\"string\",\"expands\":{}},\"expands\":{\"source\":\"device\",\"type\":[\"write\",\"read\",\"report\"],\"metrics\":[]},\"id\":\"b\",\"name\":\"b\",\"sortsIndex\":1}]}",
"transportProtocol": "MQTT",
"deviceType": {
"text": "网关设备",
"value": "gateway"
},
"configuration": {
"secureId": "waitdelete",
"secureKey": "****************"
},
"state": 1,
"creatorId": "1199596756811550720",
"createTime": 1695376779513,
"regulator": false,
"accessId": "6b194cc8d70376c3dfc623b47aacb558",
"accessProvider": "child-device",
"accessName": "内置MQTT子设备接入网关",
"superProductType": {
"text": "普通产品",
"value": "commonProduct"
},
"virtualType": {
"text": "真实设备",
"value": "real"
},
"productCreateType": {
"text": "手动",
"value": "manual"
},
"modifierId": "1199596756811550720",
"modifyTime": 1695376779513,
"threeDimensionalUrl": "/images/card/product.png",
"deviceNum": 1,
"modelFrom": "自定义",
"presetType": {
"text": "非内置",
"value": "none"
}
},
"status": 200,
"timestamp": 1695621631935
}