Update README.md
This commit is contained in:
parent
c2d8bed9e3
commit
d0329ec297
@ -241,7 +241,7 @@ DELETE:删除数据,非明文 | base_url/delete/ | {TableName:{"id":id}, "ta
|
||||
|
||||
## <h2 id="4">4.功能符<h2/>
|
||||
|
||||
键值对格式 | 功能 与 作用 | 使用示例
|
||||
键值对格式 | 功能与作用 | 使用示例
|
||||
------------ | ------------ | ------------
|
||||
"key[]":{},后面是JSONObject | 查询数组 | ["User[]":{"User":{"sex":1}}](http://139.196.140.118:8080/get/{"User[]":{"count":3,"User":{"sex":1}}}),查询性别为女的一个User数组,请求完成后会变为 "User[]":{"0":{"User":{"id":38710,"sex":1,"name":"Tommy"...}}, "1":{"User":{"id":82001,"sex":1,"name":"Lemon"...}} ...}
|
||||
"key{}":[],后面是JSONArray,作为key可取的值的选项 | 匹配选项范围 | "id{}":[38710,82001,70793],查询id符合38710,82001,70793中任意一个的Object。一般用于查询一个数组。请求[{"[]":{"User":{"id{}":[38710,82001,70793]}}}](http://139.196.140.118:8080/get/{"[]":{"count":3,"User":{"id{}":[38710,82001,70793]}}})会返回一个User数组,例如上面那个。
|
||||
@ -252,7 +252,7 @@ DELETE:删除数据,非明文 | base_url/delete/ | {TableName:{"id":id}, "ta
|
||||
"key+":key指定类型的Object,且类型为Number,String,JSONArray中的一种。如 1,"apijson",["url0","url1"] 等。只用于PUT请求 | 增加<br /> /<br />扩展 | "praiseUserIdList+":[1],添加一个点赞用户id,即该用户点了赞
|
||||
"key-":key指定类型的Object,同"key+" | 减少<br /> /<br />去除 | "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),可过滤黑名单的消息。
|
||||
"@key":key指定类型的Object,@key为JSONObject中的关键字,作用各不相同,但都不作为查询匹配条件<br /><br />① "@column":"key0,key1...", 指定返回字段<br />② "@order":"key0,key1+,key2-...", 指定排序方式<br />③ "@group":"key0,key1,key2...", 指定分组方式 | 关键词 | ① 只查询id,sex,name这几列并且请求结果也按照这个顺序:<br />["@column":"id,sex,name"](http://139.196.140.118:8080/get/{"User":{"@column":"id,sex,name","id":38710}})<br />返回<br />{<br /> "id":1,<br /> "sex":0,<br /> "name":"Lemon"<br />}<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 />返回<br />{<br /> "0":{<br /> "User":{<br /> "name":"B"<br /> "id":2<br /> },<br /> "1":{<br /> "User":{<br /> "name":"B"<br /> "id":3<br /> },<br /> "2":{<br /> "User":{<br /> "name":"A"<br /> "id":1<br /> },<br /> ...<br /> }<br />}<br /> ③ 从pictureList获取第0张图片:<br />[{<br /> "@position":0, //这里@position为自定义关键词<br /> "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 />返回<br />{<br /> "pictureList":["url0","url1"],<br /> "@position":0,<br /> "firstPicture":"url0"<br />}<br /> ...
|
||||
"@key":key指定类型的Object,@key为JSONObject中的关键字,作用各不相同,但都不作为查询匹配条件<br /><br />① "@column":"key0,key1...", 指定返回字段<br />② "@order":"key0,key1+,key2-...", 指定排序方式<br />③ "@group":"key0,key1,key2...", 指定分组方式 | 关键词,客户端可自定义未定义的关键词 | ① 只查询id,sex,name这几列并且请求结果也按照这个顺序:<br />["@column":"id,sex,name"](http://139.196.140.118:8080/get/{"User":{"@column":"id,sex,name","id":38710}})<br />返回<br />{<br /> "id":1,<br /> "sex":0,<br /> "name":"Lemon"<br />}<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 />返回<br />{<br /> "0":{<br /> "User":{<br /> "name":"B"<br /> "id":2<br /> },<br /> "1":{<br /> "User":{<br /> "name":"B"<br /> "id":3<br /> },<br /> "2":{<br /> "User":{<br /> "name":"A"<br /> "id":1<br /> },<br /> ...<br /> }<br />}<br /> ③ 从pictureList获取第0张图片:<br />[{<br /> "@position":0, //这里@position为自定义关键词<br /> "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 />返回<br />{<br /> "pictureList":["url0","url1"],<br /> "@position":0,<br /> "firstPicture":"url0"<br />}<br /> ...
|
||||
|
||||
## <h2 id="5">5.使用方法<h2/>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user