该接口支持查询全部设备,支持设置查询条件对产品列表进行筛选。
请求接口
POST /api/device-product/_query/
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
X-Access-Token | header | string | 是 | 平台token |
body | body | object | 否 | - |
» pageSize | body | integer | 否 | 每页数量 |
» pageIndex | body | integer | 否 | 页码,从0开始 |
» sorts | body | [object] | 否 | 排序,可以根据多个字段排序 |
»» name | body | string | 否 | 排序字段名称 |
»» order | body | string | 否 | 排序方式:asc(升序)、desc(降序) |
» terms | body | [object] | 否 | 查询条件 |
»» terms | body | [object] | 否 | 查询条件 |
»»» column | body | string | 否 | 条件属性名称 |
»»» value | body | string | 否 | 条件属性值 |
»»» termType | body | string | 否 | 查询条件:like(模糊查询)、eq(等于) |
»»» type | body | string | 否 | 多个条件关联类型,可用值:or、and |
» current | body | integer | 否 | 当前页面 |
响应参数
以200 Response为例,响应参数如下:
名称 | 类型 | 必选 | 约束 | 说明 |
---|---|---|---|---|
» message | string | true | none | 返回信息 |
» result | object | true | none | 返回结果 |
»» pageIndex | integer | true | none | 页码,从0开始 |
»» pageSize | integer | true | none | 每页数量 |
»» total | integer | true | none | 产品总数 |
»» data | [object] | true | none | 产品数据 |
»»» id | string | false | none | 产品ID |
»»» name | string | false | none | 产品名称 |
»»» photoUrl | string | false | none | 产品图标URL |
»»» classifiedId | string | false | none | 产品分类ID |
»»» classifiedName | string | false | none | 产品分类名称 |
»»» messageProtocol | string | false | none | 产品协议包ID |
»»» protocolName | string | false | none | 产品协议包名称 |
»»» metadata | string | false | none | 产品物模型 |
»»» transportProtocol | string | false | none | 接入协议 |
»»» deviceType | object | false | none | 设备类型 |
»»»» text | string | true | none | 内容 |
»»»» value | string | true | none | 值 |
»»» configuration | object | false | none | 协议配置信息 |
»»»» secureId | string | true | none | 密钥ID |
»»»» secureKey | string | true | none | 密钥Key |
»»» state | integer | false | none | 产品当前状态 |
»»» creatorId | string | false | none | 创建者ID |
»»» createTime | integer | false | none | 创建时间 |
»»» orgId | string | false | none | 组织ID |
»»» storePolicy | string | false | none | 数据存储策略 |
» status | integer | true | none | 响应状态码 |
» timestamp | integer | true | none | 时间戳 |
响应状态码
状态码 | 状态码含义 | 说明 |
---|---|---|
200 | OK | 成功 |
401 | Unauthorized | 登录状态已过期,token不能为空 |
500 | Internal Server Error | 服务器内部异常 |
Body示例
json
{
"pageSize":10,
"pageIndex":0,
"sorts": [
{
"name":"createTime",
"order":"desc"
}
],
"current":1,
"terms":[
{
"terms":[
{
"termType":"eq",
"column":"superProductType",
"value":"commonProduct",
"type":"and"
}
]
}
]
}
{
"pageSize":10,
"pageIndex":0,
"sorts": [
{
"name":"createTime",
"order":"desc"
}
],
"current":1,
"terms":[
{
"terms":[
{
"termType":"eq",
"column":"superProductType",
"value":"commonProduct",
"type":"and"
}
]
}
]
}
返回示例
以200 Response为例:
json
{
"message": "success",
"result": {
"pageIndex": 0,
"pageSize": 10,
"total": 1,
"data": [
{
"id": "zzzzzz",
"name": "zzzzzz",
"photoUrl": "/images/card/product.png",
"classifiedId": "-20-201-20101-",
"classifiedName": "开鸿控制器",
"messageProtocol": "d79e86511a67fc42fc0683a3917de033",
"protocolName": "内置协议",
"metadata": "{\"events\":[{\"expands\":{\"level\":\"ordinary\"},\"valueType\":{\"type\":\"object\",\"expands\":{},\"properties\":[{\"valueType\":{\"expands\":{},\"type\":\"int\"},\"id\":\"11\",\"name\":\"11\"}]},\"id\":\"11\",\"name\":\"11\",\"sortsIndex\":0}],\"properties\":[{\"sortsIndex\":12,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"网络\",\"description\":\"网络\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_net\"},{\"sortsIndex\":11,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"AI加速卡\",\"description\":\"AI加速卡\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_ai_accelerator_card\"},{\"sortsIndex\":10,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"边缘运行时版本\",\"description\":\"边缘运行时版本\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_runtime_version\"},{\"sortsIndex\":9,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"Docker版本\",\"description\":\"Docker版本\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_docker_version\"},{\"sortsIndex\":8,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"系统版本\",\"description\":\"系统版本\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_system_version\"},{\"sortsIndex\":7,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"操作系统\",\"description\":\"操作系统\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_system\"},{\"sortsIndex\":6,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"存储使用率\",\"description\":\"存储使用率\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_storage_usage_rate\"},{\"sortsIndex\":5,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"存储大小\",\"description\":\"存储大小\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_storage_capacity\"}]}",
"transportProtocol": "MQTT",
"deviceType": {
"text": "直连设备",
"value": "device"
},
"configuration": {
"secureId": "zzzzzz",
"secureKey": "038479693851365f"
},
"state": 1,
"creatorId": "1199596756811550720",
"createTime": 1690447090600,
"regulator": false,
"accessId": "6b194cc8d70376c3dfc623b47aacb558",
"accessProvider": "child-device",
"accessName": "内置MQTT子设备接入网关",
"storePolicy": "none",
"superProductType": {
"text": "普通产品",
"value": "commonProduct"
},
"virtualType": {
"text": "真实设备",
"value": "real"
},
"productCreateType": {
"text": "手动",
"value": "manual"
},
"modifierId": "1199596756811550720",
"modifyTime": 1690450822978,
"manufacturer": "",
"threeDimensionalUrl": "/images/card/product.png",
"deviceNum": 1,
"modelFrom": "自定义",
"presetType": {
"text": "非内置",
"value": "none"
}
}
]
},
"status": 200,
"timestamp": 1690790755601
}
{
"message": "success",
"result": {
"pageIndex": 0,
"pageSize": 10,
"total": 1,
"data": [
{
"id": "zzzzzz",
"name": "zzzzzz",
"photoUrl": "/images/card/product.png",
"classifiedId": "-20-201-20101-",
"classifiedName": "开鸿控制器",
"messageProtocol": "d79e86511a67fc42fc0683a3917de033",
"protocolName": "内置协议",
"metadata": "{\"events\":[{\"expands\":{\"level\":\"ordinary\"},\"valueType\":{\"type\":\"object\",\"expands\":{},\"properties\":[{\"valueType\":{\"expands\":{},\"type\":\"int\"},\"id\":\"11\",\"name\":\"11\"}]},\"id\":\"11\",\"name\":\"11\",\"sortsIndex\":0}],\"properties\":[{\"sortsIndex\":12,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"网络\",\"description\":\"网络\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_net\"},{\"sortsIndex\":11,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"AI加速卡\",\"description\":\"AI加速卡\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_ai_accelerator_card\"},{\"sortsIndex\":10,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"边缘运行时版本\",\"description\":\"边缘运行时版本\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_runtime_version\"},{\"sortsIndex\":9,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"Docker版本\",\"description\":\"Docker版本\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_docker_version\"},{\"sortsIndex\":8,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"系统版本\",\"description\":\"系统版本\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_system_version\"},{\"sortsIndex\":7,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"操作系统\",\"description\":\"操作系统\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_system\"},{\"sortsIndex\":6,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"存储使用率\",\"description\":\"存储使用率\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_storage_usage_rate\"},{\"sortsIndex\":5,\"valueType\":{\"expands\":{},\"type\":\"string\"},\"name\":\"存储大小\",\"description\":\"存储大小\",\"expands\":{\"source\":\"device\",\"metrics\":[],\"type\":[\"read\",\"report\"]},\"id\":\"real_state_storage_capacity\"}]}",
"transportProtocol": "MQTT",
"deviceType": {
"text": "直连设备",
"value": "device"
},
"configuration": {
"secureId": "zzzzzz",
"secureKey": "038479693851365f"
},
"state": 1,
"creatorId": "1199596756811550720",
"createTime": 1690447090600,
"regulator": false,
"accessId": "6b194cc8d70376c3dfc623b47aacb558",
"accessProvider": "child-device",
"accessName": "内置MQTT子设备接入网关",
"storePolicy": "none",
"superProductType": {
"text": "普通产品",
"value": "commonProduct"
},
"virtualType": {
"text": "真实设备",
"value": "real"
},
"productCreateType": {
"text": "手动",
"value": "manual"
},
"modifierId": "1199596756811550720",
"modifyTime": 1690450822978,
"manufacturer": "",
"threeDimensionalUrl": "/images/card/product.png",
"deviceNum": 1,
"modelFrom": "自定义",
"presetType": {
"text": "非内置",
"value": "none"
}
}
]
},
"status": 200,
"timestamp": 1690790755601
}