目录

APIJSON实践

APIJSON实践

获取特定对象

指定数据库服务器和schema进行查询:

1
http://localhost:8088/get/{"Test":{"ID_":5},"@schema":"sxb","@database":"MYSQL"}

获取列表:

[返回特定字段]

1
http://localhost:8088/get/{"[]":{"count":100,"Test":{"@column":"USER_ID,TM_ID"}},"@schema":"sxb","@database":"MYSQL"}

[返回全部字段列表]

1
http://localhost:8088/get/{"[]":{"count":100,"Test":{"@column":""}},"@schema":"sxb","@database":"MYSQL"} 

[分页]

1
http://localhost:8088/get/{"[]":{"count":100,"page":0,"Test":{"@column":""}},"@schema":"sxb","@database":"MYSQL"}   

[特定字段条件查询]

1
http://localhost:8088/get/{"Test":{"ID_":5},"@schema":"sxb","@database":"MYSQL"}


[连续范围]

1
http://localhost:8088/get/{"Test":{"END_TIME%":"2018,2019"},"@schema":"sxb","@database":"MYSQL"}  

!以上链接直接浏览器请求出错

[时间范围]

1
http://localhost:8088/get/{"[]":{"count":100,"Test":{"END_TIME{}":"<=2019,>=2018"}},"@schema":"sxb","@database":"MYSQL"} 

[模糊匹配]

1
http://localhost:8088/get/{"[]":{"count":100,"Test":{"END_TIME$":"%2019%"}},"@schema":"sxb","@database":"MYSQL"} 

详细的功能符号介绍:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"key[]":{}                                         // 查询数组

"key{}":[1,2,3]                                    // 匹配选项范围

"key{}":"<=10;length(key)>1..."                    // 匹配条件范围

"key()":"function(arg0,arg1...)"                   // 远程调用函数

"[email protected]":"key0/key1.../targetKey"                    // 引用赋值

"key$":"%abc%"                                     // 模糊搜索

"key~":"^[0-9]+$"                                  // 正则匹配

"key%":"2018-01-01,2018-10-01"                     // 连续范围

"key+":[1]                                         // 增加/扩展

"key-":888.88                                      // 减少/去除 

"name:alias"                                       // 新建别名

"@combine":"name~,tag~"                            // 条件组合

"@column":"id,sex,name"                            // 返回字段

"@group":"userId"                                  // 分组方式

"@having":"max(id)>=100"                           // 聚合函数

"@order":"date-,name+"                             // 排序方式

"@schema":"sys"                                    // 集合空间

"@database":"POSTGRESQL"                           // 跨数据库

"@explain":true                                    // 性能分析

"@role":"LOGIN"                                    // 访问角色

详细功能符说明可见通用文档