:::info
💡 类似 数据表 id 参数不 事先传给 服务端,而是在接口参数中传递
公网测试 url 前缀: signal-detect-api.xiaxudong.com/
:::
导入postman 文件方便调用
signal-detect-service.postman_collection.json
接口格式说明
接口使用 restful api
当接口调用成功,返回 200,201 等 HTTP 状态码,
body 直接返回 json 内容,如无说明 body 不返回内容
当 接口调用出错,返回 400 ,403 等 HTTP 状态码,
body 返回错误信息,格式 例如:
{"code": "error_token","message": "token不存在,请登录"}
权限验证
:::info
登录成功,注册成功后 接口返回 token 字段,前端存储到 LocalStorage,
每次请求在 header 带上,示例: token: 1e972b64-2ab5
token 超时时间 在 服务端维护,token 无效 HTTP 状态码为 401
测试环境可以使用 token: debug ,方便调试
:::
toekn 失效返回内容
{"code": "error_token","message": "token不存在,请登录"}
{"code": "token_expire","message": "token已过期,请重新登录"}
注册
- URL:
/admin/register - Method:
POST
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| name | body | |
| password | body |
请求示例
{"name": "admin","password": "admin"}
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
{"name": "admin","token": "1e972b64-2ab5-4b0f-8dc6-ba714a63bdb3"}
失败返回
| HTTP 状态码 | code | message |
|---|---|---|
| 409 | admin_exists | 管理员已存在 |
登录
请求
- URL:
/admin/login - Method:
POST
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| name | body | |
| password | body |
请求示例
{"name": "admin","password": "admin"}
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
{"name": "admin","token": "ef1c89b3-2649-40ad-84f0-1a725a73fb4d"}
失败返回
| HTTP 状态码 | code | message |
|---|---|---|
| 401 | password_error | 用户名或密码错误 |
注销
HTTP 请求 header 要带 token
- URL:
/admin/logout - Method:
POST
请求参数
无
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
文件树
菜单树列表
- URL:
/menu/tree - Method:
GET
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
返回说明
| 字段 | 含义 |
|---|---|
| id | 菜单 ID |
| parentId | 父菜单 ID |
| type | folder:文件夹 db: 数据库 |
| name | 名字 |
| createdAt | 创建时间 |
| children | 子项列表 |
根据 type 判断是 文件夹 还是 数据库, 叶子节点 type == ‘db’ 是数据库 非叶子节点 type == ‘folder’ 是文件夹
返回示例
[{"id": 1,"parentId": 0,"type": "folder","childrenIds": "2,3","name": "变电站列表1","sourceId": null,"createdAt": "2022-06-13T15:38:42.000+08:00","children": [{"id": 2,"parentId": 1,"type": "folder","childrenIds": "7","name": "01站","sourceId": null,"createdAt": "2022-06-13T16:05:10.000+08:00","children": [{"id": 7,"parentId": 2,"type": "db","childrenIds": null,"name": "数据库1","sourceId": 1,"createdAt": "2022-06-13T17:55:38.000+08:00","children": null}]},{"id": 3,"parentId": 1,"type": "folder","childrenIds": null,"name": "02站","sourceId": null,"createdAt": "2022-06-13T16:06:48.000+08:00","children": null}]},{"id": 4,"parentId": 0,"type": "folder","childrenIds": "5,6","name": "变电站列表2","sourceId": null,"createdAt": "2022-06-13T16:12:22.000+08:00","children": [{"id": 5,"parentId": 4,"type": "folder","childrenIds": null,"name": "41menu","sourceId": null,"createdAt": "2022-06-13T16:12:39.000+08:00","children": null},{"id": 6,"parentId": 4,"type": "folder","childrenIds": null,"name": "4-2文件夹","sourceId": null,"createdAt": "2022-06-13T16:13:05.000+08:00","children": null}]}]
创建文件夹(不包括数据库)
- URL:
/menu - Method:
POST
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| parentId | body | 父 menu 的 id,如果是根目录 传0 |
| name | body | 名字 |
请求示例
{"parentId": 0,"name": "变电站列表1"}
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
返回说明
| 字段 | 含义 |
|---|---|
| id | 菜单 ID |
| parentId | 父菜单 ID |
| type | folder:文件夹 db: 数据库 |
| name | 名字 |
| createdAt | 创建时间 |
返回示例
{"id": 3,"parentId": 1,"type": "folder","childrenIds": null,"name": "02站","sourceId": null,"createdAt": "2022-06-13T16:06:47.655+08:00","children": null}
失败返回
| HTTP 状态码 | code | message |
|---|---|---|
| 404 | not_found | 父项不存在 |
修改文件夹名称(不包括数据库)
- URL:
/menu - Method:
PUT
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| id | body | 菜单 ID |
| name | body | 名字 |
请求示例
{"id":5,"name":"41menu"}
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
删除 文件夹/数据库
- URL:
/menu/{id} - Method:
DELETE
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| id | url 路径 | 菜单 ID, 删除数据库 也是 传 菜单ID 就是菜单树列表接口里的 id 字段 |
请求示例
DELETE /menu/5
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
数据库
创建数据库
- URL:
/db - Method:
POST
请求参数
| 参数 | 位置 | 类型 | 含义 |
|---|---|---|---|
| parentMenuId | body |
Long | 父菜单ID |
| name | string | 数据库名字 | |
| title1 | string | 通道1 名字 | |
| title2 | string | 通道2 名字 | |
| title3 | string | 通道3 名字 | |
| title4 | string | 通道4 名字 | |
| space12 | double | 1和2 的间距 | |
| space23 | double | 2和 3 的间距 | |
| space34 | double | 3 和 4 的间距 | |
| channelStateList | List | 通道状态列表。0:不使用,1:使用,2:环境采集 | |
| note | String | 说明 |
请求示例
{"parentMenuId":6,"name":"数据库5","title1":"传感器1","title2":"传感器2","title3":"传感器3","title4":"传感器4","space12":1.4,"space23":2.5,"space34":6.7,"channelStateList":[1,1,1,1],"note":"这是备注"}
成功返回
返回值创建的数据库的信息
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
{"id": 4,"parentMenuId": 6,"name": "数据库5","monitorDuration": null,"dischargeNum": null,"title1": "传感器1","title2": "传感器2","title3": "传感器3","title4": "传感器4","space12": 1.4,"space23": 2.5,"space34": 6.7,"channelState": "1,1,1,1","note": "这是备注","status": "active","createdAt": "2022-06-19T20:32:10.892+08:00","channelStateList": [1,1,1,1]}
修改数据库
- URL:
/db - Method:
PUT
请求参数
| 参数 | 位置 | 类型 | 含义 |
|---|---|---|---|
| name | body | string | 数据库名字 |
| title1 | string | 通道1 名字 | |
| title2 | string | 通道2 名字 | |
| title3 | string | 通道3 名字 | |
| title4 | string | 通道4 名字 | |
| space12 | double | 1和2 的间距 | |
| space23 | double | 2和 3 的间距 | |
| space34 | double | 3 和 4 的间距 | |
| channelStateList | List | 通道状态列表。0:不使用,1:使用,2:环境采集 | |
| note | String | 说明 |
请求示例
最好把下面所有参数都传过来
{"id": 4,"name": "更新名字","title1": "传感器111","title2": "传感器222","title3": "传感器333","title4": null,"space12": 1.499,"space23": 2.599,"space34": 5.66,"channelStateList":[1,1,1,0],"note": "这是备注999"}
成功返回
返回更新后的信息
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
{"id": 4,"parentMenuId": 6,"name": "更新名字","monitorDuration": null,"dischargeNum": null,"title1": "传感器111","title2": "传感器222","title3": "传感器333","title4": null,"space12": 1.499,"space23": 2.599,"space34": null,"channelState": "1,1,1,0","note": "这是备注999","status": "active","createdAt": "2022-06-19T20:32:11.000+08:00","channelStateList": [1,1,1,0]}
失败返回
| HTTP 状态码 | code | message |
|---|---|---|
| 404 | not_found | 数据库不存在 |
获取数据库信息
- URL:
/db/{id} - Method:
GET
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| id | url 路径 | 数据库id |
请求示例
GET /db/1
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
{"id": 4,"parentMenuId": 6,"name": "更新名字","monitorDuration": null,"dischargeNum": null,"title1": "传感器111","title2": "传感器222","title3": "传感器333","title4": null,"space12": 1.499,"space23": 2.599,"space34": null,"channelState": "1,1,1,0","note": "这是备注999","status": "active","createdAt": "2022-06-19T20:32:11.000+08:00","channelStateList": [1,1,1,0]}
获取数据库统计信息
- URL:
/db/{id}/stat - Method:
GET
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| id | url 路径 | 数据库id |
请求示例
GET /db/1/stat
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
:::success 点击列表某一栏,第二页 把 locationList.dayList 带过去,是第二页的日期高亮 :::
| 字段 | 含义 | |||
|---|---|---|---|---|
| signalNum | 放电数 | |||
| sampleStatus | true:采集中 false: 未在采集 | |||
| monitorDuration | 监测时长 | |||
| locationList | ||||
| dayList | 这些点的日期(可能有多个) | |||
| ratio | 比例(乘以100了),比如,0.99 就代表比例是 0.99% |
|||
| strengthMax | 好像没什么用,目前是写死100,需要的话给我反馈 | |||
{"baseInfo": {"id": 1,"parentMenuId": 2,"name": "更新名字","title1": "传感器111","title2": "传感器222","title3": "传感器333","title4": null,"space12": 1.1,"space23": 2.2,"space34": null,"channelState": "1,1,1,0","note": "这是备注999","status": "active","createdAt": "2022-06-13 17:55:38","xin": 0.3125,"channelStateList": [1,1,1,0]},"locationList": [{"sampleCount": 333,"displayLocation": -13.14,"color": "blue","strengthMax": 100,"dayList": ["2021-05-12"],"caption": "传感器2右侧附近或传感器2左侧","locname": "局放点0","id": 1,"type": "内部或外侧信号","ratio": 0.99},{"sampleCount": 351,"displayLocation": 2.2,"color": "blue","strengthMax": 100,"dayList": ["2021-05-12"],"caption": "传感器3左侧附近或传感器3右侧","locname": "局放点1","id": 2,"type": "内部或外侧信号","ratio": 1.04},{"sampleCount": 216,"displayLocation": 0.0,"color": "blue","strengthMax": 100,"dayList": ["2021-05-12"],"caption": "传感器1右侧附近或传感器1左侧","locname": "局放点2","id": 3,"type": "内部或外侧信号","ratio": 0.64},{"sampleCount": 297,"displayLocation": 3.3,"color": "blue","strengthMax": 100,"dayList": ["2021-05-12"],"caption": "传感器3左侧附近或传感器3右侧","locname": "局放点3","id": 4,"type": "内部或外侧信号","ratio": 0.88},{"sampleCount": 297,"displayLocation": 1.1,"color": "blue","strengthMax": 100,"dayList": ["2021-05-12"],"caption": "传感器2左侧附近或传感器2右侧","locname": "局放点4","id": 5,"type": "内部或外侧信号","ratio": 0.88},{"sampleCount": 423,"displayLocation": 0.0,"color": "blue","strengthMax": 100,"dayList": ["2021-05-12"],"caption": "传感器1右侧附近或传感器1左侧","locname": "局放点5","id": 6,"type": "内部或外侧信号","ratio": 1.26},{"sampleCount": 1818,"displayLocation": null,"color": "blue","strengthMax": 100,"dayList": ["2021-05-12"],"caption": "仅通道3检测到非噪声信号","locname": "单通道3","id": 7,"type": "单通道信号","ratio": 5.4},{"sampleCount": 1764,"displayLocation": null,"color": "blue","strengthMax": 100,"dayList": ["2021-05-12"],"caption": "仅通道2检测到非噪声信号","locname": "单通道2","id": 8,"type": "单通道信号","ratio": 5.24},{"sampleCount": 1647,"displayLocation": null,"color": "blue","strengthMax": 100,"dayList": ["2021-05-12"],"caption": "仅通道1检测到非噪声信号","locname": "单通道1","id": 9,"type": "单通道信号","ratio": 4.9},{"sampleCount": 26496,"displayLocation": null,"color": "blue","strengthMax": 100,"dayList": ["2021-05-12"],"caption": "噪声","locname": "噪声","id": 10,"type": "噪声","ratio": 78.76}],"signalNum": 2346,"sampleStatus": false,"monitorDuration": "7天19小时10分钟22秒"}
采样
获取采集状态
- URL:
/sample/status - Method:
GET
请求参数
无
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
| 字段 | 类型 | 含义 |
|---|---|---|
| isSampling | bool | 是否正在采样 |
| dbId | Long | 正在采样的数据库 ID |
返回示例
{"dbId": 1,"isSampling": true}
开始采集
- URL:
/sample/start - Method:
POST
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| dbId | body | 数据库ID |
| argTime | body | 时基参数 |
| argThreshold | body | 阈值参数 |
请求示例
{"dbId":1,"argTime":2000,"argThreshold":100}
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
失败返回
| HTTP 状态码 | code | message |
|---|---|---|
| 409 | task_exists | 此数据库采集任务正在运行中 |
停止采集
- URL:
/sample/stop - Method:
POST
请求参数
无
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
失败返回
| HTTP 状态码 | code | message |
|---|---|---|
| 404 | no_sample_running | 没有正在采集的任务 |
图表接口
:::success
尽量把参数在调用每个图表接口的时候传过去
服务端尽量不保存状态
:::
查看有数据日期列表
- URL:
/data/days?dbId=1 - Method:
GET
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| dbId | url 参数 | 数据库ID |
请求示例
/data/days?dbId=1
成功返回
返回日期列表,顺序从小到大
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
["2022-06-13","2022-06-14"]
趋势图
- URL:
/data/trend_charts?dbId=12&day=2022-06-14 - Method:
GET
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| dbId | url 参数 | 数据库ID |
| day | url参数 | 选定日期,格式: 2022-06-14 |
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
字段说明
| 字段 | 含义 | |||
|---|---|---|---|---|
| sampleCount | 数据 数目 | |||
| strengthMax | 最大 峰值 | |||
| data | ||||
| x | x 轴时间刻度 | |||
| y | ||||
| y[0] | 通道1 的 数据 | |||
| y[1] | 通道2 的 数据 | |||
| y[2] | 通道3 的 数据 | |||
| y[3] | 通道4 的 数据 |
示例
{"sampleCount": 62,"data": {"x": ["00:00","00:05","00:10","00:15","00:20","00:25","00:30","00:35","00:40","00:45","00:50","00:55","01:00","01:05","01:10","01:15","01:20","01:25","01:30","01:35","01:40","01:45","01:50","01:55","02:00","02:05","02:10","02:15","02:20","02:25","02:30","02:35","02:40","02:45","02:50","02:55","03:00","03:05","03:10","03:15","03:20","03:25","03:30","03:35","03:40","03:45","03:50","03:55","04:00","04:05","04:10","04:15","04:20","04:25","04:30","04:35","04:40","04:45","04:50","04:55","05:00","05:05","05:10","05:15","05:20","05:25","05:30","05:35","05:40","05:45","05:50","05:55","06:00","06:05","06:10","06:15","06:20","06:25","06:30","06:35","06:40","06:45","06:50","06:55","07:00","07:05","07:10","07:15","07:20","07:25","07:30","07:35","07:40","07:45","07:50","07:55","08:00","08:05","08:10","08:15","08:20","08:25","08:30","08:35","08:40","08:45","08:50","08:55","09:00","09:05","09:10","09:15","09:20","09:25","09:30","09:35","09:40","09:45","09:50","09:55","10:00","10:05","10:10","10:15","10:20","10:25","10:30","10:35","10:40","10:45","10:50","10:55","11:00","11:05","11:10","11:15","11:20","11:25","11:30","11:35","11:40","11:45","11:50","11:55","12:00","12:05","12:10","12:15","12:20","12:25","12:30","12:35","12:40","12:45","12:50","12:55","13:00","13:05","13:10","13:15","13:20","13:25","13:30","13:35","13:40","13:45","13:50","13:55","14:00","14:05","14:10","14:15","14:20","14:25","14:30","14:35","14:40","14:45","14:50","14:55","15:00","15:05","15:10","15:15","15:20","15:25","15:30","15:35","15:40","15:45","15:50","15:55","16:00","16:05","16:10","16:15","16:20","16:25","16:30","16:35","16:40","16:45","16:50","16:55","17:00","17:05","17:10","17:15","17:20","17:25","17:30","17:35","17:40","17:45","17:50","17:55","18:00","18:05","18:10","18:15","18:20","18:25","18:30","18:35","18:40","18:45","18:50","18:55","19:00","19:05","19:10","19:15","19:20","19:25","19:30","19:35","19:40","19:45","19:50","19:55","20:00","20:05","20:10","20:15","20:20","20:25","20:30","20:35","20:40","20:45","20:50","20:55","21:00","21:05","21:10","21:15","21:20","21:25","21:30","21:35","21:40","21:45","21:50","21:55","22:00","22:05","22:10","22:15","22:20","22:25","22:30","22:35","22:40","22:45","22:50","22:55","23:00","23:05","23:10","23:15","23:20","23:25","23:30","23:35","23:40","23:45","23:50","23:55"],"y": [[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]]},"strengthMax": 2.4}
柱状图
- URL:
/data/histogram - Method:
GET
请求参数
| 参数 | 位置 | 是否必选 | 含义 |
|---|---|---|---|
| dbId | url 参数 | 是 | 数据库ID |
| day | url参数 | 是 | 日期,格式 2021-05-12 |
| startTime | url 参数 | 否 | 筛选开始时间 格式:17:53 |
| endTime | url 参数 | 否 | 筛选结束时间 格式: 17:53 |
| channelId | url 参数 | 否,默认 1 | 通道ID, 1: 通道1 2: 通道2 。。。 |
| phaseMove | url 参数 | 否,默认0 | 相位偏移 |
请求示例
curl --location --request GET 'signal-detect-api.xiaxudong.com/data/histogram?dbId=1&startTime=17:53&channelId=2&phaseMove=10&day=2021-05-12&endTime=17:58'
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
| 字段 | 含义 |
|---|---|
| x | 时间秒数 |
| y | 相位 |
| z | 峰值 |
{
"x": [
64431.705,
64432.038,
64432.259,
64432.448,
64432.631,
64433.704,
64433.938,
64434.141,
64434.334,
64434.579
],
"y": [
11.940407,
253.637038,
334.917588,
27.682735,
80.544509,
142.644121,
249.763577,
153.033035,
237.675457,
123.956501
],
"z": [
315.873097,
401.216004,
795.084863,
673.326506,
213.0653,
574.8743,
68.3417,
582.9145,
132.6633,
530.6532
]
}
散点图
- URL:
/data/scatter_graph - Method:
GET
请求参数
| 参数 | 位置 | 是否必选 | 含义 |
|---|---|---|---|
| dbId | url 参数 | 是 | 数据库ID |
| day | url 参数 | 是 | 日期,格式 2021-05-12 |
| startTime | url 参数 | 否 | 筛选开始时间 格式:17:53 |
| endTime | url 参数 | 否 | 筛选结束时间 格式: 17:53 |
| channelId | url 参数 | 否,默认1 | 通道ID, 1: 通道1 2: 通道2 。。。 |
| phaseMove | url 参数 | 否。默认0 | 相位偏移 |
请求示例
curl --location --request GET 'signal-detect-api.xiaxudong.com/data/scatter_graph?dbId=1&startTime=17:53&endTime=17:58&channelId=2&phaseMove=10&day=2021-05-12'
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
| 字段 | 含义 |
|---|---|
| g | 干扰值 |
| x | 相位 |
| y | 峰值 |
| id | 信号 ID |
[
{
"g": null,
"x": 11.940407,
"y": 315.873097,
"id": 1
},
{
"g": null,
"x": 253.637038,
"y": 401.216004,
"id": 2
},
{
"g": null,
"x": 334.917588,
"y": 795.084863,
"id": 3
},
{
"g": null,
"x": 27.682735,
"y": 673.326506,
"id": 4
},
{
"g": null,
"x": 80.544509,
"y": 213.0653,
"id": 5
},
{
"g": null,
"x": 142.644121,
"y": 574.8743,
"id": 6
},
{
"g": null,
"x": 249.763577,
"y": 68.3417,
"id": 7
},
{
"g": null,
"x": 153.033035,
"y": 582.9145,
"id": 8
},
{
"g": null,
"x": 237.675457,
"y": 132.6633,
"id": 9
},
{
"g": null,
"x": 123.956501,
"y": 530.6532,
"id": 10
}
]
大/小 波形图
- URL:
/data/wave_graph - Method:
GET:::success 小波形图传 getInfo=false, 大波形图传 getInfo=true ::: 请求参数
| 参数 | 位置 | 类型 | 含义 |
|---|---|---|---|
| day | url 参数 | string | 天,格式:2021-05-12 |
| id | url 参数 | long | 信号 ID |
| getInfo | url 参数 | boolean | 是否获取 相关信息和时间差数据 |
| filterWave | url 参数 | boolean | 是否滤波 |
请求示例
curl --location --request GET 'localhost:8081/data/wave_graph?day=2021-05-12&id=1&getInfo=1'
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
| 字段 | 含义 | |
|---|---|---|
| t | 时间列表, 即 X 轴数据 | |
| channels | 四个通道数据,第一个 子项 对应第一个通道 | |
| y | 波形点 y 轴数据,与 t 长度相同 | |
| head_x | 起始点 X坐标 | |
| head_y | 起始点 Y 坐标 | |
| info | ||
| signalTime | 序号 | |
| duration | 时间 | |
| path | 设备 | |
| note | 备注 | |
| time12 | 1超前2 | |
| time23 | 2超前3 | |
| time34 | 3超前4 | |
| cList | 四个通道数据 |
{
"info": {
"signalTime": "17:53",
"duration": "03:20",
"path": "变电站列表1/01站/更新名字",
"note": "",
"time12": 196.25,
"time23": -196.875,
"time34": null,
"time13": -0.625,
"time24": null,
"cList": [
928.168097,
315.873097,
438.494757,
null
],
"time14": null
},
"t": [
0.3125,
0.625,
0.9375,
1.25,
1.5625,
1.875,
2.1875,
2.5
],
"channels": [
{
"y": [
-1963.4325132710771,
1606.4447835854269,
535.4815945284755,
-892.4693242141259,
-1427.9509187426015,
1606.4447835854269,
-178.4938648428252,
-1784.9386484282518,
-356.9877296856504
],
"head_x": 1.5625,
"head_y": -892.4693242141259
},
{
"y": [
728.9379171218253,
-425.2137849877315,
-121.48965285363757,
182.23447928045633,
546.7034378413691,
-668.1930906950067,
242.97930570727513,
182.23447928045633,
-182.23447928045633
],
"head_x": 1.5625,
"head_y": -485.95861141455026
},
{
"y": [
-548.1184459083698,
-548.1184459083698,
0.0,
0.0,
-548.1184459083698,
0.0,
0.0,
0.0,
0.0,
-548.1184459083698,
-548.1184459083698
],
"head_x": 1.5625,
"head_y": -548.1184459083698
},
{
"y": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"head_x": null,
"head_y": null
}
]
}
更新波形说明
- URL:
/signal - Method:
PUT
请求参数
| 参数 | 位置 | 含义 |
|---|---|---|
| id | body | 信号ID |
| day | body | 天, 格式: 2021-05-12 |
| note | body | 说明 |
请求示例
curl --location --request PUT 'localhost:8081/signal' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":1,
"day": "2021-05-12",
"note": "sssss"
}'
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
散点图数据分页列表
- URL:
/scatter_data/list - Method:
POST
请求参数
| 参数 | 位置 | 是否必选 | 含义 |
|---|---|---|---|
| dbId | body |
是 | 数据库 ID |
| day | 是 | 日期,格式: 2021-05-12 | |
| startTime | 否 | 开始时间,格式: 19:53 | |
| endTime | 否 | 结束时间,格式: 19:53 | |
| selectedIds | 否 | 反选保留下来的id 列表,例如:[1,2,3] | |
| excludeIds | 否 | 删除的id 列表,例如: [1,2,3] | |
| sort | 否 | 排序项,取值: c1 c2 c3 c4 time12 time13 time14 time23 time24 time34 id | |
| asc | 否 | true 或 false ,是否正序 | |
| page | 是 | 第几页 | |
| pageSize | 是 | 一页多少个 |
请求示例
curl --location --request POST 'signal-detect-api.xiaxudong.com/scatter_data/list' \
--header 'Content-Type: application/json' \
--data-raw '{
"dbId":1,
"day":"2021-05-12",
"startTime": "17:53",
"endTime": "19:53",
"selectedIds": [],
"excludeIds":[1,2,3,4],
"sort":"time12",
"asc":true,
"page":1,
"pageSize":3
}'
成功返回
状态码
| HTTP 状态码 | 含义 |
|---|---|
| 200 | 成功 |
{
"page": 1,
"pageSize": 3,
"totalSize": 3766,
"totalPage": 1256,
"data": [
{
"id": 1143,
"time": "2021-05-12T18:54:54.404+08:00",
"c1": 842.784979,
"c2": 27.126675,
"c3": 238.794419,
"c4": null,
"time12": -196.25,
"time13": -134.6875,
"time14": null,
"time23": 61.5625,
"time24": null,
"time34": null,
"note": ""
},
{
"id": 1282,
"time": "2021-05-12T18:56:27.194+08:00",
"c1": 1405.489845,
"c2": 862.537403,
"c3": 87.544105,
"c4": null,
"time12": -163.75,
"time13": -92.5,
"time14": null,
"time23": 71.25,
"time24": null,
"time34": null,
"note": ""
},
{
"id": 25,
"time": "2021-05-12T17:54:25.810+08:00",
"c1": 145.542843,
"c2": 4.112978,
"c3": 768.123932,
"c4": null,
"time12": -163.4375,
"time13": -180.0,
"time14": null,
"time23": -16.5625,
"time24": null,
"time34": null,
"note": ""
}
]
}

