Skip to content

获取设备列表信息 (POST)

更新时间:

该接口用于根据参数查询设备列表信息,支持模糊查询。

请求接口

POST /api/device-instance/_query/

TIP

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

请求参数

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

响应参数

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

名称类型必选约束说明
» messagestringtruenone返回信息
» resultobjecttruenone返回结果
»» pageIndexintegertruenone页码,从0开始
»» pageSizeintegertruenone每页数量
»» totalintegertruenone总数
»» data[object]truenone数据
»»» idstringtruenoneID
»»» namestringtruenone设备名称
»»» photoUrlstringtruenone设备图片URL
»»» deviceTypeobjecttruenone设备类型
»»»» textstringtruenone内容
»»»» valuestringtruenone
»»» productIdstringtruenone产品ID
»»» productNamestringtruenone产品名称
»»» configurationstringtruenone配置信息
»»»» secureIdstringtruenone密钥ID
»»»» channelIdstringtruenone通道ID
»»»» secureKeystringtruenone密钥Key
»»» deviceMetadatastringfalsenone设备物模型
»»» stateobjectfalsenone设备状态
»»»» textstringtruenone内容
»»»» valuestringtruenone
»»»edgebooleantruenone是否为边缘设备
»»» creatorIdstringtruenone创建者ID
»»» creatorNamestringtruenone创建者姓名
»»» creatTimestringtruenone创建时间
»»» registryTimestringtruenone注册时间
»»» features[object]truenone设备特性
»»» virtualTypeobjectfalsenone虚拟类型
»»»» textstringtruenone内容
»»»» valuestringtruenone
»»»superDeviceTypeobjectfalsenone超级设备类型
»»»» textstringtruenone内容
»»»» valuestringtruenone
»»» stateobjectfalsenone状态
»»»» textstringtruenone内容
»»»» valuestringtruenone
»»» configurationobjectfalsenone配置信息
»»»» secureIdstringtruenoneMQTT密钥ID
»»»» secureKeystringtruenoneMQTT密钥Key
»»» state[object]falsenone状态
»»»» textstringtruenone内容
»»»» valuestringtruenone
»»» creatorIdstringfalsenone创建者ID
»»» createTimeintegerfalsenone创建时间
»»» orgIdstringfalsenone组织ID
»»» storePolicystringfalsenone数据存储策略
» statusintegertruenone响应状态码
» timestampintegertruenone时间戳

响应状态码

状态码状态码含义说明
200OK成功
401Unauthorized登录状态已过期,token不能为空
500Internal Server Error服务器内部异常

Body示例

json
{
  "current":1,
  "pageSize":1,
  "pageIndex":0,
  "terms":[
    {
      "terms":[
        {
          "termType":"eq",
          "column":"superDeviceType",
          "value":"normalDevice",
          "type":"and"
        }
      ]
    }
  ],
  "sorts":[
    {
      "name":"createTime",
      "order":"desc"
    }
  ]
}
{
  "current":1,
  "pageSize":1,
  "pageIndex":0,
  "terms":[
    {
      "terms":[
        {
          "termType":"eq",
          "column":"superDeviceType",
          "value":"normalDevice",
          "type":"and"
        }
      ]
    }
  ],
  "sorts":[
    {
      "name":"createTime",
      "order":"desc"
    }
  ]
}

返回示例

以200 Response为例:

json
{
  "message": "success",
  "result": {
    "pageIndex": 0,
    "pageSize": 19,
    "total": 914,
    "data": [
      {
      "id": "ceshi",
      "photoUrl": "/images/card/product.png",
      "name": "%",
      "deviceType": {
        "text": "直连设备",
        "value": "device"
      },
      "productId": "yz-prd",
      "productName": "yz-直连产品",
      "state": {
        "text": "离线",
        "value": "offline"
      },
      "edge": false,
      "superDeviceType": {
        "text": "普通设备",
        "value": "normalDevice"
      },
      "creatorId": "1199596756811550720",
      "creatorName": "\t\r\n室内安防",
      "createTime": 1690525378505,
      "registryTime": 1690525378524,
      "features": [],
      "virtualType": {
        "text": "真实设备",
        "value": "real"
      },
      "regulator": false,
      "comeFrom": {
        "text": "云生成",
        "value": "cloud"
      },
      "deviceCreateType": {
        "text": "根据产品(超级设备模型)生成",
        "value": "fromProduct"
      },
      "modifyTime": 1690525378505,
      "modifierId": "1199596756811550720",
      "modifierName": "\t\r\n室内安防",
      "presetType": {
        "text": "非内置",
        "value": "none"
      },
      "categoryType": {
        "text": "默认类型",
        "value": "none"
      },
      "mediaDevice": false
      }
    ]
  },
    "status": 200,
    "timestamp": 1690869409124
}
{
  "message": "success",
  "result": {
    "pageIndex": 0,
    "pageSize": 19,
    "total": 914,
    "data": [
      {
      "id": "ceshi",
      "photoUrl": "/images/card/product.png",
      "name": "%",
      "deviceType": {
        "text": "直连设备",
        "value": "device"
      },
      "productId": "yz-prd",
      "productName": "yz-直连产品",
      "state": {
        "text": "离线",
        "value": "offline"
      },
      "edge": false,
      "superDeviceType": {
        "text": "普通设备",
        "value": "normalDevice"
      },
      "creatorId": "1199596756811550720",
      "creatorName": "\t\r\n室内安防",
      "createTime": 1690525378505,
      "registryTime": 1690525378524,
      "features": [],
      "virtualType": {
        "text": "真实设备",
        "value": "real"
      },
      "regulator": false,
      "comeFrom": {
        "text": "云生成",
        "value": "cloud"
      },
      "deviceCreateType": {
        "text": "根据产品(超级设备模型)生成",
        "value": "fromProduct"
      },
      "modifyTime": 1690525378505,
      "modifierId": "1199596756811550720",
      "modifierName": "\t\r\n室内安防",
      "presetType": {
        "text": "非内置",
        "value": "none"
      },
      "categoryType": {
        "text": "默认类型",
        "value": "none"
      },
      "mediaDevice": false
      }
    ]
  },
    "status": 200,
    "timestamp": 1690869409124
}