Skip to content

查询产品详情 (GET)

更新时间:

该接口支持根据ID查询产品详情。

请求接口

GET /api/device-product/{id}

TIP

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

请求参数

名称位置类型必选说明
idpathstring产品唯一标识ID
X-Access-Tokenheaderstring平台token

响应参数

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

名称类型必选约束中文名
» messagestringtruenone返回信息
» resultobjecttruenone返回结果
»» idstringtruenone产品ID
»» namestringtruenone产品名称
»» photoUrlstringtruenone产品图标URL
»» classifiedIdstringtruenone产品分类ID
»» classifiedNamestringtruenone产品分类名称
»» messageProtocolstringtruenone产品协议包ID
»» protocolNamestringtruenone产品协议包名称
»» metadatastringtruenone产品物模型
»» transportProtocolstringtruenone连接协议
»» deviceTypeobjecttruenone设备类型
»»» textstringtruenone设备类型名称
»»» valuestringtruenone设备类型标识
»» configurationobjecttruenone协议配置信息
»» stateintegertruenone产品当前状态
»» creatorIdstringtruenone创建者ID
»» createTimeintegertruenone创建时间
»» accessIdstringtruenone接入网关ID
»» accessProviderstringtruenone接入服务
»» accessNamestringtruenone接入网关名称
»» storePolicystringtruenone数据存储策略
»» modifierIdstringtruenone修改者ID
»» modifyTimeintegertruenone修改时间
» statusintegertruenone响应状态码
» timestampintegertruenone时间戳

响应状态码

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