[TOC]
简要描述
请求URL
请求方式
参数
参数名 |
必选 |
类型 |
说明 |
name |
是 |
string |
模块名称 |
type |
是 |
string |
方法名称 |
packid |
是 |
string |
方法id,默认null |
param |
是 |
dict |
参数 |
cache |
是 |
string |
缓存方式,默认all |
children |
是 |
string |
递归config |
请求示例
{
"name":"source",
"type":"sql",
"packid":null,
"cache":"cache",
"param":{
"num":100,
"sql":"select * from xmr_test",
"dbtype":"mysql",
"info":{
"host":"127.0.0.1",
"port":3306,
"dbtype":"mysql",
"database":"test",
"user":"root",
"password":"123456"
},
"model":"normal"
},
"children":[
{
"name":"dtransform",
"type":"compound",
"packid":null,
"cache":"cache",
"param":{
"config":[
{
"func":"add_col",
"add_dict": [
{"col":"hhhhhh",
"funcstr":"{spcdata}+50"
}
]
},
{
"func":"add_col",
"add_dict": [
{"col":"ttttttt",
"funcstr":"{spcdata}+100"
}
]
}
]
},
"children":[
]
}
]
}
返回示例
{
"result": {
"data": [
[
"2020-11-02T15:21:29",
2.07,
52.07,
102.07
],
[
"2020-11-02T15:21:30",
1.98,
51.98,
101.98
],
[
"2020-11-02T15:21:31",
1.79,
51.79,
101.79
],
[
"2020-11-02T15:21:32",
3.12,
53.12,
103.12
],
[
"2020-11-02T15:21:33",
4.89,
54.89,
104.89
]
],
"column": {
"spctime": {
"dtype": "datetime"
},
"spcdata": {
"dtype": "data"
},
"hhhhhh": {
"dtype": "data"
},
"ttttttt": {
"dtype": "data"
}
}
},
"message": "查询成功",
"status": 200
}
返回参数说明
参数名 |
类型 |
说明 |
status |
int |
响应状态码 |
result |
dict |
返回结果 |
message |
string |
响应状态信息 |
返回示例
注意
- 数据库参数的"model"要用"simple",表示只取前50条数据
- 编辑器建议用compound函数,将所有的计算方法变为列表,后端依次回调执行