Update README.md

This commit is contained in:
TommyLemon 2017-04-03 19:23:42 +08:00 committed by GitHub
parent df60c56da8
commit 6eb9875fd7

View File

@ -251,7 +251,7 @@ DELETE删除数据非明文 | base_url/delete/ | {TableName:{"id":id}, "ta
"key$":"SQL搜索表达式"任意SQL搜索表达式字符串如 %key%, %k%e%y% 等 | 模糊搜索 | "name$":"%m%"搜索包含m的名字。一般用于查询一个数组。请求 [{"[]":{"User":{"name$":"%m%"}}}](http://139.196.140.118:8080/get/%7B%22%5B%5D%22%3A%7B%22User%22%3A%7B%22name%24%22%3A%22%2525m%2525%22%7D%2C%22count%22%3A3%2C%22page%22%3A0%7D%7D) 会返回name包含"m"的User数组。
"key+":key指定类型的Object且类型为Number,String,JSONArray中的一种。如 1,"apijson",["url0","url1"] 等。只用于PUT请求 | 增加 / 扩展 | "praiseUserIdList+":[1]添加一个点赞用户id即该用户点了赞
"key-":key指定类型的Object同"key+" | 减少 / 去除 | "balance-":100.00余额减少100.00即花费了100元
&, \|, ! 逻辑运算符。<br />& 可用于"key&{}":"条件"等。<br />\| 可用于"key\|{}":"条件", "key\|{}":[]等。<br />! 可单独使用,如"key!":Object也可像&,\|一样配合其他功能符使用等。 | 逻辑运算 | ["id&{}":">80000,<=90000"](http://139.196.140.118:8080/head/{"User":{"id&{}":">80000,<=90000"}})即id满足id>80000 & id<=90000。<br />["id|{}":">80000,<=90000"](http://139.196.140.118:8080/head/{"User":{"id|{}":">80000,<=90000"}}),同"id{}":">80000,<=90000"即id满足id>80000 \| id<=90000。<br />["id!{}":[82001,38710]](http://139.196.140.118:8080/head/{"User":{"id!{}":[82001,38710]}})即id满足 ! (id=82001 \| id=38710),可过滤黑名单的消息。
&, \|, ! 逻辑运算符。<br />& 可用于"key&{}":"条件"等。<br />\| 可用于"key\|{}":"条件", "key\|{}":[]等。<br />! 可单独使用,如"key!":Object也可像&,\|一样配合其他功能符使用等。 | 逻辑运算 | ["id&{}":">80000,<=90000"](http://139.196.140.118:8080/head/{"User":{"id&{}":">80000,<=90000"}})即id满足id>80000 & id<=90000。<br />["id|{}":">80000,<=90000"](http://139.196.140.118:8080/head/{"User":{"id|{}":">80000,<=90000"}}),同"id{}":">80000,<=90000"即id满足id>80000 \| id<=90000。<br />["id!{}":[82001,38710]](http://139.196.140.118:8080/head/{"User":{"id!{}":[82001,38710]}})即id满足 ! (id=82001 \| id=38710),可过滤黑名单的消息。
"@key":key指定类型的Object@key为JSONObject中的关键词<br />① "@column":"key0,key1...", 指定返回字段<br />② "@order":"key0,key1+,key2-...",指定排序方式<br />③ "@group":"key0,key1,key2..."指定分组方式分组的key必须在@column里声明<br />④ "@having":"function0(...)?valu0,function1(...)?valu1,function2(...)?value2...",指定分组函数条件,必须和@group一起用且函数一般在@column里声明 | 关键词,可自定义 | ① 只查询id,sex,name这几列并且请求结果也按照这个顺序<br />["@column":"id,sex,name"](http://139.196.140.118:8080/get/{"User":{"@column":"id,sex,name","id":38710}})<br /> ② 查询按name降序,id默认顺序排序的User数组<br />["@order":"name-,id"](http://139.196.140.118:8080/get/{"[]":{"count":10,"User":%7B"@column":"name,id","@order":"name-,id"}}})<br /> ③ 查询按userId分组的Moment数组<br />["@group"="userId,id"](http://139.196.140.118:8080/get/{"[]":{"count":10,"Moment":%7B"@column":"userId,id","@group":"userId,id"}}})<br /> ④ 查询按userId分组且id总和<1000的Moment数组<br />["@having":"sum(id)<1000"](http://139.196.140.118:8080/get/{"[]":{"count":10,"Moment":%7B"@column":"userId,sum(id)","@group":"userId","@having":"sum(id)<1000"}}})<br /> ⑤ 从pictureList获取第0张图片<br />[{<br /> &nbsp; "@position":0, //这里@position为自定义关键词<br /> &nbsp; "firstPicture()":"get(Collection:pictureList,int:@position)"<br />}](http://139.196.140.118:8080/get/{"User":{"id":38710,"@position":0,"firstPicture()":"get(Collection:pictureList,int:@position)"}})<br /> ...
## <h2 id="5">5.使用方法<h2/>