Update Document.md

This commit is contained in:
TommyLemon 2018-06-12 22:37:39 +08:00 committed by GitHub
parent 95af248106
commit 10790eae78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -364,6 +364,6 @@ DELETE: <br > 删除数据 | base_url/delete/ | {<br > &nbsp;&nbsp; TableName:{<
减少 或 去除 | "key-":Object与"key+"相反 | "balance-":100.00余额减少100.00即花费了100元
逻辑运算 | &, \|, ! 逻辑运算符。<br />& 可用于"key&{}":"条件"等<br />② \| 可用于"key\|{}":"条件", "key\|{}":[]等,一般可省略<br />③ ! 可单独使用,如"key!":Object也可像&,\|一样配合其他功能符使用 | ① ["id&{}":">80000,<=90000"](http://apijson.cn:8080/head/{"User":{"id&{}":">80000,<=90000"}})即id满足id>80000 & id<=90000<br /> ② ["id\|{}":">90000,<=80000"](http://apijson.cn:8080/head/{"User":{"id\|{}":">90000,<=80000"}}),同"id{}":">90000,<=80000"即id满足id>90000 \| id<=80000<br /> ③ ["id!{}":[82001,38710]](http://apijson.cn:8080/head/{"User":{"id!{}":[82001,38710]}})即id满足 ! (id=82001 \| id=38710),可过滤黑名单的消息
数组关键词 | "key":Objectkey为 "[]":{} 中{}内的关键词Object的类型由key指定<br />① "count":Integer指定查询数量假设允许查询数组的最大数量为max则当count在1~max范围内时查询count个否则查询max个 <br />② "page":Integer指定查询页码从0开始一般和count一起用<br />③ "query":Integer指定查询内容<br />0-对象1-总数2-以上全部<br />总数关键词为total和query同级通过引用赋值得到如 "total@":"/[]/total" <br />这里query及total仅为GET类型的请求提供方便一般可直接用HEAD类型的请求获取总数 | ① 查询User数组最多5个<br />["count":5](http://apijson.cn:8080/get/{"[]":{"count":5,"User":{}}})<br /> ② 查询第3页的User数组每页5个<br />["count":5,<br />"page":3](http://apijson.cn:8080/get/{"[]":{"count":5,"page":3,"User":{}}})<br /> ③ 查询User数组和对应的User总数<br />["[]":{<br /> &nbsp;&nbsp; "query":2,<br /> &nbsp;&nbsp; "User":{}<br />},<br />"total@":"/[]/total"](http://apijson.cn:8080/get/{"[]":{"query":2,"count":5,"User":{}},"total@":"%252F[]%252Ftotal"})
对象关键词,可自定义 | "@key":Object@key为 Table:{} 中{}内的关键词Object的类型由@key指定<br />① "@combine":"key0,&key1,\|key2,!key3,...", 指定条件组合方式<br />② "@column":"key0,key1...", 指定返回字段<br />③ "@order":"key0,key1+,key2-...",指定排序方式<br />④ "@group":"key0,key1,key2...",指定分组方式。如果@column里声明了Table的id则id也必须在@group中声明其它情况下必须满足至少一个条件:<br />1.分组的key在@column里声明<br />2.Table主键在@group中声明 <br />⑤ "@having":"function0(...)?valu0,function1(...)?valu1,function2(...)?value2..."指定SQL函数条件一般和@group一起用函数一般在@column里声明<br /> ⑥ "@otherKey": Object自定义关键词名称和以上系统关键词不一样且原样返回上传的值 | ① 搜索name或tag任何一个字段包含字符a的User列表<br />["name?":"a",<br />"tag?":"a",<br />"@combine":"name?,tag?"](http://apijson.cn:8080/get/{"User[]":{"User":{"@column":"id,name,tag","name%253F":"a","tag%253F":"a","@combine":"name%253F,tag%253F"}}})<br /> ② 只查询id,sex,name这几列并且请求结果也按照这个顺序<br />["@column":"id,sex,name"](http://apijson.cn:8080/get/{"User":{"@column":"id,sex,name","id":38710}})<br /> ③ 查询按 name降序、id默认顺序 排序的User数组<br />["@order":"name-,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"User":{"@column":"name,id","@order":"name-,id"}}})<br /> ④ 查询按userId分组的Moment数组<br />["@group":"userId,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":%7B"@column":"userId,id","@group":"userId,id"}}})<br /> ⑤ 查询 按userId分组、id最大值>=100 的Moment数组<br />["@column":"userId,max(id)",<br />"@group":"userId",<br />"@having":"max(id)>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId,max(id)","@group":"userId","@having":"max(id)>=100"}}})<br />还可以指定函数返回名:<br />["@column":"userId,max(id):maxId",<br />"@group":"userId",<br />"@having":"maxId>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId,max(id):maxId","@group":"userId","@having":"maxId>=100"}}})<br /> ⑥ 从pictureList获取第0张图片<br />["@position":0, //这里@position为自定义关键词<br />"firstPicture()":"getFromArray(pictureList,@position)"](http://apijson.cn:8080/get/{"User":{"id":38710,"@position":0,"firstPicture()":"getFromArray(pictureList,@position)"}})<br /> ...
对象关键词,可自定义 | "@key":Object@key为 Table:{} 中{}内的关键词Object的类型由@key指定<br />① "@combine":"key0,&key1,\|key2,!key3,...", 指定条件组合方式<br />② "@column":"key0,key1...", 指定返回字段<br />③ "@order":"key0,key1+,key2-...",指定排序方式<br />④ "@group":"key0,key1,key2...",指定分组方式。如果@column里声明了Table的id则id也必须在@group中声明其它情况下必须满足至少一个条件:<br />1.分组的key在@column里声明<br />2.Table主键在@group中声明 <br />⑤ "@having":"function0(...)?valu0,function1(...)?valu1,function2(...)?value2..."指定SQL函数条件一般和@group一起用函数一般在@column里声明<br /> ⑥ "@otherKey": Object自定义关键词名称和以上系统关键词不一样且原样返回上传的值 | ① 搜索name或tag任何一个字段包含字符a的User列表<br />["name?":"a",<br />"tag?":"a",<br />"@combine":"name?,tag?"](http://apijson.cn:8080/get/{"User[]":{"count":10,"User":{"@column":"id,name,tag","name%253F":"a","tag%253F":"a","@combine":"name%253F,tag%253F"}}})<br /> ② 只查询id,sex,name这几列并且请求结果也按照这个顺序<br />["@column":"id,sex,name"](http://apijson.cn:8080/get/{"User":{"@column":"id,sex,name","id":38710}})<br /> ③ 查询按 name降序、id默认顺序 排序的User数组<br />["@order":"name-,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"User":{"@column":"name,id","@order":"name-,id"}}})<br /> ④ 查询按userId分组的Moment数组<br />["@group":"userId,id"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":%7B"@column":"userId,id","@group":"userId,id"}}})<br /> ⑤ 查询 按userId分组、id最大值>=100 的Moment数组<br />["@column":"userId,max(id)",<br />"@group":"userId",<br />"@having":"max(id)>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId,max(id)","@group":"userId","@having":"max(id)>=100"}}})<br />还可以指定函数返回名:<br />["@column":"userId,max(id):maxId",<br />"@group":"userId",<br />"@having":"maxId>=100"](http://apijson.cn:8080/get/{"[]":{"count":10,"Moment":{"@column":"userId,max(id):maxId","@group":"userId","@having":"maxId>=100"}}})<br /> ⑥ 从pictureList获取第0张图片<br />["@position":0, //这里@position为自定义关键词<br />"firstPicture()":"getFromArray(pictureList,@position)"](http://apijson.cn:8080/get/{"User":{"id":38710,"@position":0,"firstPicture()":"getFromArray(pictureList,@position)"}})<br /> ...
<br />