Skip to content

获取产品列表信息 (POST)

更新时间:

该接口支持查询全部设备,支持设置查询条件对产品列表进行筛选。

请求接口

POST /api/device-product/_query/

TIP

访问权限:需要登录超级设备管理平台获取token,并校验token

请求参数

名称位置类型必选说明
X-Access-Tokenheaderstring平台token
bodybodyobject-
» pageSizebodyinteger每页数量
» pageIndexbodyinteger页码,从0开始
» sortsbody[object]排序,可以根据多个字段排序
»» namebodystring排序字段名称
»» orderbodystring排序方式:asc(升序)、desc(降序)
» termsbody[object]查询条件
»» termsbody[object]查询条件
»»» columnbodystring条件属性名称
»»» valuebodystring条件属性值
»»» termTypebodystring查询条件:like(模糊查询)、eq(等于)
»»» typebodystring多个条件关联类型,可用值:or、and
» currentbodyinteger当前页面

响应参数

以200 Response为例,响应参数如下:

名称类型必选约束说明
» messagestringtruenone返回信息
» resultobjecttruenone返回结果
»» pageIndexintegertruenone页码,从0开始
»» pageSizeintegertruenone每页数量
»» totalintegertruenone产品总数
»» data[object]truenone产品数据
»»» idstringfalsenone产品ID
»»» namestringfalsenone产品名称
»»» photoUrlstringfalsenone产品图标URL
»»» classifiedIdstringfalsenone产品分类ID
»»» classifiedNamestringfalsenone产品分类名称
»»» messageProtocolstringfalsenone产品协议包ID
»»» protocolNamestringfalsenone产品协议包名称
»»» metadatastringfalsenone产品物模型
»»» transportProtocolstringfalsenone接入协议
»»» deviceTypeobjectfalsenone设备类型
»»»» textstringtruenone内容
»»»» valuestringtruenone
»»» configurationobjectfalsenone协议配置信息
»»»» secureIdstringtruenone密钥ID
»»»» secureKeystringtruenone密钥Key
»»» stateintegerfalsenone产品当前状态
»»» creatorIdstringfalsenone创建者ID
»»» createTimeintegerfalsenone创建时间
»»» orgIdstringfalsenone组织ID
»»» storePolicystringfalsenone数据存储策略
» statusintegertruenone响应状态码
» timestampintegertruenone时间戳

响应状态码

状态码状态码含义说明
200OK成功
401Unauthorized登录状态已过期,token不能为空
500Internal 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
}