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 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E6=95=B0=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 From 92284f55a8753de1bb6dac52fb648ed91e91eb34 Mon Sep 17 00:00:00 2001 From: huguanghan Date: Mon, 21 Oct 2024 09:15:37 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=AB=98=E9=A2=91=EF=BC=8C=E4=BD=8E?= =?UTF-8?q?=E9=A2=91=E6=95=B0=E6=8D=AEtdengine=E5=85=A5=E5=BA=93=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/das/modules/node/service/impl/DataServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/das/src/main/java/com/das/modules/node/service/impl/DataServiceImpl.java b/das/src/main/java/com/das/modules/node/service/impl/DataServiceImpl.java index 78690aea..5e57d30b 100644 --- a/das/src/main/java/com/das/modules/node/service/impl/DataServiceImpl.java +++ b/das/src/main/java/com/das/modules/node/service/impl/DataServiceImpl.java @@ -288,7 +288,7 @@ public class DataServiceImpl implements DataService { keyValueMap.put(fieldName, values.get(fieldName)); } - Long dataTime = data.getTime(); + Long dataTime = jsonNode.get("dataTime").asLong(); List highList = new ArrayList<>(); RTData rtHighData = RTData.builder() .dataTime(dataTime) @@ -315,7 +315,7 @@ public class DataServiceImpl implements DataService { keyValueMap.put(fieldName, values.get(fieldName)); } - Long dataTime = data.getTime(); + Long dataTime = jsonNode.get("dataTime").asLong(); List highList = new ArrayList<>(); RTData rtHighData = RTData.builder() .dataTime(dataTime) From 4c055eec2af6085d4c2864f43e64fd14aa952ced 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:47:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E5=8C=BA=E9=97=B4=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/data.md | 57 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/docs/api/data.md b/docs/api/data.md index 1aa56b13..6db5d5e9 100644 --- a/docs/api/data.md +++ b/docs/api/data.md @@ -75,6 +75,8 @@ data 中以字典的方式,返回查询的每个设备的属性的实时值。 ### 历史区间数据查询 +根据提供的开始时间及结束时间,查询指定设备在指定时间段内的历史数据。 + POST 请求接口 > /api/data/history @@ -84,16 +86,37 @@ POST 请求接口 ```json { - "deviceId":"129476828342323", - "attributes":["power","windSpeed","dailyUsageHours","monthlyUsageHours"] + //开始时间 + "startTime": "123452435324242", + //结束时间 + "endTime": "123452435924242", + //查询设备列表 + "devices": [ + { + //设备ID + "deviceId":"129476828342323", + //要查询的属性列表 + "attributes":["power","windSpeed"] + }, + { + "deviceId":"129476828342324", + "attributes":["power","dailyUsageHours"] + } + ], + "interval": "1h" } + ``` 入参描述 | 参数名 | 参数类型 | 可选 | 描述 | | ------------ | -------- | ---- |------| -| deviceId | String | no | 设备ID | -| attributes | StringArray | no | 要查询实时数据的设备属性列表 | +| startTime | String | no | 开始时间戳 | +| endTime | String | no | 结束时间戳 | +| devices.deviceId | String | no | 设备ID | +| devices.attributes | StringArray | no | 要查询实时数据的设备属性列表 | +| interval | String | yes | 抽样间隔,1a(毫秒),1s(秒),1m(分),1h(小时),1d(天),1w(周)。 忽略或者值为空时,返回原始数据(不抽样) | +| endTime | String | no | 结束时间戳 | 返回报文 @@ -103,14 +126,22 @@ POST 请求接口 "msg": "操作成功", "success": true, "data": { - "power": 56.2, - "windSpeed": 45.3, - "dailyUsageHours": 20, - "monthlyUsageHours": 78, - .... + //设备ID + "129476828342323":{ + //属性名 + "power": { + //时间戳列表 + "times": [123452435924242,123452435924342,123452435924442,123452435924542], + //值列表 + "values": [123.23,35.21,34.56,67] + } , + //属性名 + "windSpeed": { + "times": [123452435924242,123452435924342,123452435924442,123452435924542], + "values": [123.23,35.21,34.56,67] + } + }, + ....... } } -``` -返参描述 - -data 中以字典的方式,返回查询的属性的实时值。 \ No newline at end of file +``` \ No newline at end of file From 4dde3b98a73d74795841593fbc67dbdd9ef09084 Mon Sep 17 00:00:00 2001 From: yu Date: Mon, 21 Oct 2024 10:16:51 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E9=85=8D=E7=BD=AEupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/das/modules/auth/controller/SysMenusController.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/das/src/main/java/com/das/modules/auth/controller/SysMenusController.java b/das/src/main/java/com/das/modules/auth/controller/SysMenusController.java index f95da79e..45b33017 100644 --- a/das/src/main/java/com/das/modules/auth/controller/SysMenusController.java +++ b/das/src/main/java/com/das/modules/auth/controller/SysMenusController.java @@ -41,9 +41,6 @@ public class SysMenusController { if(!hasPermission){ return R.fail("没有系统管理权限"); } - if (StringUtils.isAllEnglishLetters(sysMenuDto.getMenuName())){ - return R.fail("菜单名称,必须为英文"); - } return R.success(sysMenuService.createMenu(sysMenuDto)); }