From fdaaa5ad999d82f220923d964627099a3c6bb400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=B7=E6=88=90=E4=BC=9F?= Date: Thu, 17 Oct 2024 17:13:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/_sidebar.md | 4 ++++ docs/api/_sidebar.md | 5 +--- docs/api/data.md | 54 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 docs/api/data.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index b734321e..b18bdbdb 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -1,3 +1,7 @@ - [首页](/) - [API说明](api/) + - [系统管理接口](api/systemmgr.md) + - [设备管理接口](api/equipment.md) + - [节点管理接口](api/node.md) + - [数据访问接口](api/data.md) - [数据采集](datacollect/) \ No newline at end of file diff --git a/docs/api/_sidebar.md b/docs/api/_sidebar.md index 516ee848..328af778 100644 --- a/docs/api/_sidebar.md +++ b/docs/api/_sidebar.md @@ -1,4 +1 @@ -* [返回首页](/) -* [设备模块](equipment.md) -* [节点模块](node.md) -* [系统管理模块](systemmgr.md) \ No newline at end of file +* [返回首页](/) \ No newline at end of file diff --git a/docs/api/data.md b/docs/api/data.md new file mode 100644 index 00000000..170afe88 --- /dev/null +++ b/docs/api/data.md @@ -0,0 +1,54 @@ +# 数据访问接口 + +## API接口一览表 + +| 接口分类 | 接口描述 | API接口 | 权限 | +|--------|-------------|------------------------------| ---------------------------- | +| 数据查询 | 实时数据查询 | /api/data/snapshot | | +| | 历史区间数据查询 | /api/data/history | | +| | 历史断面数据查询 | /api/data/history/snapshot | | + + +### 数据查询接口 + +#### 实时数据查询 + +POST 请求接口 + +> /api/data/snapshot + +请求参数 + + +```json +{ + "deviceId":"129476828342323", + "attributes":["power","windSpeed","dailyUsageHours","monthlyUsageHours"] +} +``` +入参描述 + +| 参数名 | 参数类型 | 可选 | 描述 | +| ------------ | -------- | ---- |------| +| deviceId | String | no | 设备ID | +| attributes | StringArray | no | 要查询实时数据的设备属性列表 | + +返回报文 + +```json +{ + "code": 200, + "msg": "操作成功", + "success": true, + "data": { + "power": 56.2, + "windSpeed": 45.3, + "dailyUsageHours": 20, + "monthlyUsageHours": 78, + .... + } +} +``` +返参描述 + +data 中以字典的方式,返回查询的属性的实时值。