-
Notifications
You must be signed in to change notification settings - Fork 0
collect
YourtionGuo edited this page Feb 26, 2021
·
2 revisions
请求地址:GET /collect/:table
参数名 | 位置 | 类型 | 格式化 | 必填 | 说明 |
---|---|---|---|---|---|
table |
params | String | 否 | 是 | 表名 |
// 数据表信息 - /api/collect/collect_test
input = {};
output = {
"success": true,
"result": {
"schema": {
"id": {
"name": "id",
"type": "Integer",
"comment": "",
"nullable": false,
"default": null
},
"article": {
"name": "article",
"type": "String",
"comment": "",
"nullable": false,
"default": ""
},
"count": {
"name": "count",
"type": "Integer",
"comment": "",
"nullable": false,
"default": "0"
}
},
"primary": "id",
"id": 1,
"table_name": "collect_test",
"is_update": 1
}
};
请求地址:POST /collect/:table
参数名 | 位置 | 类型 | 格式化 | 必填 | 说明 |
---|---|---|---|---|---|
table |
params | String | 否 | 是 | 表名 |
data |
body | Object | 否 | 是 | 收集的数据 |
update |
body | Boolean | 否 | 否 | 插入冲突是否更新数据 |
info |
body | Boolean | 否 | 否 | 是否需要插入后详情 |
// 创建收集数据 - /api/collect/collect_test
input = {
"data": {
"article": "CWed Feb 24 2021 17:41:19 GMT+0800 (China Standard Time)"
}
};
output = {
"success": true,
"result": "操作成功"
};
// 创建收集数据 - /api/collect/collect_test
input = {
"data": {
"count": 30,
"id": 1,
"article": "AWed Feb 24 2021 17:41:19 GMT+0800 (China Standard Time)"
},
"update": true
};
output = {
"success": true,
"result": "操作成功"
};
请求地址:PUT /collect/:table
参数名 | 位置 | 类型 | 格式化 | 必填 | 说明 |
---|---|---|---|---|---|
table |
params | String | 否 | 是 | 表名 |
field |
body | String | 否 | 是 | 唯一键名 |
data |
body | Object | 否 | 是 | 需要修改的对象 |
// 修改收集数据 - /api/collect/collect_test
input = {
"field": "id",
"data": {
"count": 20,
"id": 2
}
};
output = {
"success": true,
"result": "操作成功"
};
请求地址:GET /collect/:table/list
参数名 | 位置 | 类型 | 格式化 | 必填 | 说明 |
---|---|---|---|---|---|
table |
params | String | 否 | 是 | 表名 |
page |
query | Integer | 否 | 否 | 第n页 |
page_count |
query | Integer | 否 | 否 | 每页数量(默认30) |
order |
query | String | 否 | 否 | 排序字段(默认id) |
asc |
query | Boolean | 否 | 否 | 是否升序(默认false) |
limit |
query | Integer | 否 | 否 | 限制n条数据(优先) |
offset |
query | Integer | 否 | 否 | 跳过n条数据(优先) |
// 获取收集数据列表 - /api/collect/collect_test/list
input = {};
output = {
"success": true,
"result": {
"page_data": {
"page": 1,
"page_count": 30,
"count": 2
},
"list": [
{
"id": 1,
"article": "AWed Feb 24 2021 17:41:19 GMT+0800 (China Standard Time)",
"count": 30
},
{
"id": 2,
"article": "CWed Feb 24 2021 17:41:19 GMT+0800 (China Standard Time)",
"count": 0
}
]
}
};
请求地址:GET /collect/:table/item
参数名 | 位置 | 类型 | 格式化 | 必填 | 说明 |
---|---|---|---|---|---|
table |
params | String | 否 | 是 | 表名 |
field |
query | String | 否 | 是 | 键名 |
data |
query | String | 否 | 是 | 键值 |
rank |
query | String | 否 | 否 | 排名字段 |
count |
query | Boolean | 否 | 否 | 是否获取总数 |
// 获取收集数据条目 - /api/collect/collect_test/item?field=id&data=2&rank=id&count=true
input = {
"field": "id",
"data": 2,
"rank": "id",
"count": true
};
output = {
"success": true,
"result": {
"id": 2,
"article": "CWed Feb 24 2021 17:41:19 GMT+0800 (China Standard Time)",
"count": 2,
"rank": 1
}
};
请求地址:POST /collect/:table/incr
参数名 | 位置 | 类型 | 格式化 | 必填 | 说明 |
---|---|---|---|---|---|
table |
params | String | 否 | 是 | 表名 |
primary |
body | String | 否 | 是 | 主键值 |
primaryName |
body | String | 否 | 否 | 主键名 |
field |
body | String | 否 | 是 | 增加键 |
count |
body | Integer | 否 | 否 | 增加数量(默认1) |
// 获取收集数据列自增 - /api/collect/collect_test/incr
input = {
"primary": "2",
"field": "count",
"count": 2
};
output = {
"success": true,
"result": "操作成功"
};