From c40ef35db95dd541a1ee3e7691f60079520cfab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=B7=E6=88=90=E4=BC=9F?= Date: Mon, 21 Oct 2024 09:13:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9E=E6=97=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=8F=A3=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/data.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/docs/api/data.md b/docs/api/data.md index 6cf7b7e1..1aa56b13 100644 --- a/docs/api/data.md +++ b/docs/api/data.md @@ -20,6 +20,68 @@ POST 请求接口 请求参数 +```json +[ + { + "deviceId":"129476828342323", + "attributes":["power","windSpeed","dailyUsageHours","monthlyUsageHours"] + }, + { + "deviceId":"129476828342324", + "attributes":["power","windSpeed","dailyUsageHours","monthlyUsageHours"] + } + ...... +] + +``` +入参描述 + +| 参数名 | 参数类型 | 可选 | 描述 | +| ------------ | -------- | ---- |------| +| deviceId | String | no | 设备ID | +| attributes | StringArray | no | 要查询实时数据的设备属性列表 | + +> PS: 当attributes为空时,返回所有属性。 + +返回报文 + +```json +{ + "code": 200, + "msg": "操作成功", + "success": true, + "data": { + "129476828342323":{ + "power": 56.2, + "windSpeed": 45.3, + "dailyUsageHours": 20, + "monthlyUsageHours": 78, + .... + }, + "129476828342324":{ + "power": 53.2, + "windSpeed": 35.3, + "dailyUsageHours": 10, + "monthlyUsageHours": 48, + .... + } + } +} +``` +返参描述 + +data 中以字典的方式,返回查询的每个设备的属性的实时值。 + + +### 历史区间数据查询 + +POST 请求接口 + +> /api/data/history + +请求参数 + + ```json { "deviceId":"129476828342323", @@ -51,4 +113,4 @@ POST 请求接口 ``` 返参描述 -data 中以字典的方式,返回查询的属性的实时值。 +data 中以字典的方式,返回查询的属性的实时值。 \ No newline at end of file