3

APIJSON实践

 2 years ago
source link: https://justpic.org/posts/2019/10/27/apijson-exercise/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

APIJSON实践

获取特定对象

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

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

获取列表:

返回特定字段

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

返回全部字段列表

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

特定字段条件查询

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


连续范围

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

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

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

详细的功能符号介绍:

"key[]":{}                                         // 查询数组

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

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

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

"key@":"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"                                    // 访问角色

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK