数据清洗Api
# 说明
数据清洗的字段请查看字段说明
# 列表查询
接口说明
根据查询条件查询数据清洗列表。
接口版本
v1接口地址
/api-web-v1/ruleRecords
请求方法
GET
请求参数
参数类型 | 参数名称 | 数据类型 | 是否必须 | 参数描述 | 默认 | 示例 |
---|---|---|---|---|---|---|
query | label | string | false | 模糊查询字段 | name | |
query | search | string | false | 模糊查询值 | 测试 | |
query | time | string | false | 时间范围查询字段,必须是数据清洗字段中的时间或时间戳字段名,例如createdAt,updatedAt | createdAt | |
query | range | string[] or string | false | 时间范围,开始时间到结束时间,可以是string[]或者以逗号分割的开始时间到结束时间或时间戳 | 2019-10-22T00:00:00.000Z,2022-01-22T00:00:00.000Z | |
query | page | number | false | 分页第几页 | 1 | |
query | limit | number | false | 单页几条数据 | 10 | |
query | sort | string | false | 根据哪个字段排序 | _id | -createdAt |
query | select | string | false | 只查询部分字段,字段名之间用过空格分隔,去掉某个字段的查询字段名前面加- | ||
query | autopopulate | boolean | false | 自动关联数据,部分字段自动关联关系表查询,设置这个值可开关自动联表查询 | true | false |
query | populate | string | false | 指定关联表查询,查询多个关联表用逗号分隔 | control |
请求参数举例
注意
GET请求所有参数类型都会变成string拼接在url上面,文档为了表述清晰,将示例结构以json格式编写
{
"page":"1",
"limit":"10",
"sort":"-createdAt",
"autopopulate":"false"
}
返回参数
参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|
code | number | True | 是否成功 |
data | json | True | 返回数据 |
-total | number | False | 数据清洗总条数 |
-rows | array | False | 当前返回的数据清洗对象列表 |
返回参数举例
{
"code": 0,
"data": {
"total": 3,
"rows": [
{
"parents": [],
"type": 0,
"_id": "62ce1d6dd80c3271a700a755",
"isrun": true,
"month": 3,
"level": 1,
"cleanCon": [
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f560",
"name": "A相电压",
"shortAddress": "32",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f561",
"name": "B相电压",
"shortAddress": "33",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f562",
"name": "C相电压",
"shortAddress": "34",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f563",
"name": "A相电流",
"shortAddress": "38",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f564",
"name": "B相电流",
"shortAddress": "39",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f565",
"name": "C相电流",
"shortAddress": "3a",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f566",
"name": "电能",
"shortAddress": "a",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
}
],
"hardwareWord": "5d1f3f288ce12637b661b8e4",
"parentName": "Hardware",
"creator": "5da855b71816bc001be72f4b",
"createdAt": "2022-07-13T01:18:37.861Z",
"updatedAt": "2022-07-13T01:18:37.861Z",
"__v": 0
}
]
}
}
# 查询数据清洗ID
接口说明
根据数据清洗ID查询数据清洗
接口版本
v1接口地址
/api-v1/ruleRecords/:id
请求方法
GET
请求参数
参数类型 | 参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|---|
params | id | string | True | 数据清洗ID |
请求参数举例
注意
GET请求所有参数类型都会拼接在url上面,文档为了表述清晰,将示例结构以json格式编写
{
"_id": "62ce1d6dd80c3271a700a755"
}
返回参数
参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|
code | number | True | 是否成功 |
data | json | false | 返回数据清洗信息 |
返回参数举例
{
"code": 0,
"data": {
"parents": [],
"type": 0,
"_id": "62ce1d6dd80c3271a700a755",
"isrun": true,
"month": 3,
"level": 1,
"cleanCon": [
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f560",
"name": "A相电压",
"shortAddress": "32",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f561",
"name": "B相电压",
"shortAddress": "33",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f562",
"name": "C相电压",
"shortAddress": "34",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f563",
"name": "A相电流",
"shortAddress": "38",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f564",
"name": "B相电流",
"shortAddress": "39",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f565",
"name": "C相电流",
"shortAddress": "3a",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f566",
"name": "电能",
"shortAddress": "a",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
}
],
"hardwareWord": "5d1f3f288ce12637b661b8e4",
"parentName": "Hardware",
"creator": "5da855b71816bc001be72f4b",
"createdAt": "2022-07-13T01:18:37.861Z",
"updatedAt": "2022-07-13T01:18:37.861Z",
"__v": 0
}
}
# 新建
接口说明
新建一个数据清洗。
接口版本
v1接口地址
/api-v1/ruleRecords
请求方法
POST
请求参数
参数类型 | 参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|---|
body | - | Object | True | 数据清洗对象字段说明 |
请求参数举例
{
"parents": [],
"type": 0,
"isrun": true,
"month": 3,
"level": 1,
"cleanCon": [
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f560",
"name": "A相电压",
"shortAddress": "32",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f561",
"name": "B相电压",
"shortAddress": "33",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f562",
"name": "C相电压",
"shortAddress": "34",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f563",
"name": "A相电流",
"shortAddress": "38",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f564",
"name": "B相电流",
"shortAddress": "39",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f565",
"name": "C相电流",
"shortAddress": "3a",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f566",
"name": "电能",
"shortAddress": "a",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
}
],
"hardwareWord": "5d1f3f288ce12637b661b8e4",
"parentName": "Hardware",
"creator": "5da855b71816bc001be72f4b"
}
// Make sure to add code blocks to your code group
返回参数
参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|
code | number | True | 是否成功 |
data | json | True | 返回创建的对象 |
返回参数举例
{
"parents": [],
"type": 0,
"_id": "62ce1d6dd80c3271a700a755",
"isrun": true,
"month": 3,
"level": 1,
"cleanCon": [
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f560",
"name": "A相电压",
"shortAddress": "32",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f561",
"name": "B相电压",
"shortAddress": "33",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f562",
"name": "C相电压",
"shortAddress": "34",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f563",
"name": "A相电流",
"shortAddress": "38",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f564",
"name": "B相电流",
"shortAddress": "39",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f565",
"name": "C相电流",
"shortAddress": "3a",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f566",
"name": "电能",
"shortAddress": "a",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
}
],
"hardwareWord": "5d1f3f288ce12637b661b8e4",
"parentName": "Hardware",
"creator": "5da855b71816bc001be72f4b",
"createdAt": "2022-07-13T01:18:37.861Z",
"updatedAt": "2022-07-13T01:18:37.861Z",
"__v": 0
}
# 编辑
接口说明
修改数据清洗。
接口版本
v1接口地址
/api-v1/ruleRecords/:id
请求方法
PUT
请求参数
参数类型 | 参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|---|
params | id | string | True | 修改的数据清洗ID |
body | - | Object | True | 数据清洗对象字段说明 |
请求参数举例
{
"month":"4"
}
// Make sure to add code blocks to your code group
返回参数
参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|
code | number | True | 是否成功 |
data | json | True | 返回创建的对象 |
返回参数举例
{
"code": 0,
"data": {
"parents": [],
"type": 0,
"_id": "62ce1d6dd80c3271a700a755",
"isrun": true,
"month": 4,
"level": 1,
"cleanCon": [
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f560",
"name": "A相电压",
"shortAddress": "32",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f561",
"name": "B相电压",
"shortAddress": "33",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f562",
"name": "C相电压",
"shortAddress": "34",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f563",
"name": "A相电流",
"shortAddress": "38",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f564",
"name": "B相电流",
"shortAddress": "39",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f565",
"name": "C相电流",
"shortAddress": "3a",
"time": 900000,
"model": "check",
"precision": 0.1,
"type": 1
},
{
"extreme": [],
"_id": "5ee326843dc0d8001b09f566",
"name": "电能",
"shortAddress": "a",
"time": 900000,
"model": "check",
"precision": 1,
"type": 1
}
],
"hardwareWord": "5d1f3f288ce12637b661b8e4",
"parentName": "Hardware",
"creator": "5da855b71816bc001be72f4b",
"createdAt": "2022-07-13T01:18:37.861Z",
"updatedAt": "2022-07-13T01:18:37.861Z",
"__v": 0
}
}
# 删除
接口说明
删除一个数据清洗。
接口版本
v1接口地址
/api-v1/ruleRecords/:id
请求方法
DELETE
请求参数
参数类型 | 参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|---|
params | id | string | True | 删除的数据清洗ID |
请求参数举例
只需发送删除数据清洗的ID
返回参数
参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|
code | number | True | 是否成功 |
message | string | false | 成功删除返回complete |
返回参数举例
{
"code": 0,
"message": "complete"
}
此接口需实际数据清洗。文档不提供删除在线调试
上次更新: 2022/07/13, 14:05:11