Update Document.md

This commit is contained in:
TommyLemon 2020-03-08 02:57:46 +08:00 committed by GitHub
parent 87e40f6e00
commit 159b03d63d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -333,7 +333,7 @@ GET: <br > 普通获取数据,<br > 可用浏览器调试 | base_url/get/ | {<
HEAD: <br > 普通获取数量,<br > 可用浏览器调试 | base_url/head/ | {<br > &nbsp;&nbsp; TableName:{<br > &nbsp;&nbsp;&nbsp;&nbsp;<br > &nbsp;&nbsp; }<br > } <br > {…}内为限制条件 <br ><br > 例如获取一个 id = 38710 的 User 所发布的 Moment 总数:<br >{<br > &nbsp;&nbsp; "Moment":{<br > &nbsp;&nbsp;&nbsp;&nbsp; "userId":38710<br > &nbsp;&nbsp; }<br >} | {<br > &nbsp;&nbsp; TableName:{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "count":10<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >} <br > 例如<br >{<br > &nbsp;&nbsp; "Moment":{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "count":10<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >}
GETS: <br > 安全/私密获取数据,<br > 用于获取钱包等<br >对安全性要求高的数据 | base_url/gets/ | 最外层加一个 "tag":tag其它同GET | 同GET
HEADS: <br > 安全/私密获取数量,<br > 用于获取银行卡数量等<br >对安全性要求高的数据总数 | base_url/heads/ | 最外层加一个 "tag":tag其它同HEAD | 同HEAD
POST: <br > 新增数据 | base_url/post/ | 单个: <br > {<br > &nbsp;&nbsp; TableName:{<br > &nbsp;&nbsp;&nbsp;&nbsp;<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "tag":tag<br >} <br > {…}中id由后端生成不能传 <br ><br >例如一个 id = 38710 的 User 发布一个新 Moment<br >{<br > &nbsp;&nbsp; "Moment":{<br > &nbsp;&nbsp;&nbsp;&nbsp; "userId":38710,<br > &nbsp;&nbsp;&nbsp;&nbsp; "content":"APIJSON,let interfaces and documents go to hell !"<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "tag":"Moment"<br >}<br > <br > 批量: <br > &nbsp;&nbsp; TableName\[]:\[{<br > &nbsp;&nbsp;&nbsp;&nbsp;<br > &nbsp;&nbsp; }, {<br > &nbsp;&nbsp;&nbsp;&nbsp;<br > &nbsp;&nbsp; }],<br > &nbsp;&nbsp; "tag":tag<br >} <br > {…}中id由后端生成不能传 <br ><br >例如当前登录用户 82001 发布 2 个 Comment<br >{<br > &nbsp;&nbsp; "Comment\[]":\[{<br > &nbsp;&nbsp;&nbsp;&nbsp; "momentId":12,<br > &nbsp;&nbsp;&nbsp;&nbsp; "content":"APIJSON,let interfaces and documents go to hell !"<br > &nbsp;&nbsp; }<br >}, {<br > &nbsp;&nbsp;&nbsp;&nbsp; "momentId":15,<br > &nbsp;&nbsp;&nbsp;&nbsp; "content":"APIJSON is a JSON transmision protocol."<br > &nbsp;&nbsp; }],<br > &nbsp;&nbsp; "tag":"Comment[]"<br >}<br > | 单个: <br > {<br > &nbsp;&nbsp; TableName:{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "id":38710<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >}<br >例如<br >{<br > &nbsp;&nbsp; "Moment":{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "id":120<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >} <br > <br > 批量: <br > {<br > &nbsp;&nbsp; TableName\[]:{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "count":2,<br > &nbsp;&nbsp;&nbsp;&nbsp; "id[]":[1, 2]<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >}<br >例如<br >{<br > &nbsp;&nbsp; "Comment\[]":{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "count":2,<br > &nbsp;&nbsp;&nbsp;&nbsp; "id[]":\[1, 2]<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >}
POST: <br > 新增数据 | base_url/post/ | 单个: <br > {<br > &nbsp;&nbsp; TableName:{<br > &nbsp;&nbsp;&nbsp;&nbsp;<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "tag":tag<br >} <br > {…}中id由后端生成不能传 <br ><br >例如一个 id = 38710 的 User 发布一个新 Moment<br >{<br > &nbsp;&nbsp; "Moment":{<br > &nbsp;&nbsp;&nbsp;&nbsp; "userId":38710,<br > &nbsp;&nbsp;&nbsp;&nbsp; "content":"APIJSON,let interfaces and documents go to hell !"<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "tag":"Moment"<br >}<br > <br > 批量: <br > {<br > &nbsp;&nbsp; TableName\[]:\[{<br > &nbsp;&nbsp;&nbsp;&nbsp;<br > &nbsp;&nbsp; }, {<br > &nbsp;&nbsp;&nbsp;&nbsp;<br > &nbsp;&nbsp; }],<br > &nbsp;&nbsp; "tag":tag<br >} <br > {…}中id由后端生成不能传 <br ><br >例如当前登录用户 82001 发布 2 个 Comment<br >{<br > &nbsp;&nbsp; "Comment\[]":\[{<br > &nbsp;&nbsp;&nbsp;&nbsp; "momentId":12,<br > &nbsp;&nbsp;&nbsp;&nbsp; "content":"APIJSON,let interfaces and documents go to hell !"<br > &nbsp;&nbsp; }, {<br > &nbsp;&nbsp;&nbsp;&nbsp; "momentId":15,<br > &nbsp;&nbsp;&nbsp;&nbsp; "content":"APIJSON is a JSON transmision protocol."<br > &nbsp;&nbsp; }],<br > &nbsp;&nbsp; "tag":"Comment[]"<br >}<br > | 单个: <br > {<br > &nbsp;&nbsp; TableName:{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "id":38710<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >}<br >例如<br >{<br > &nbsp;&nbsp; "Moment":{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "id":120<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >} <br > <br > 批量: <br > {<br > &nbsp;&nbsp; TableName\[]:{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "count":2,<br > &nbsp;&nbsp;&nbsp;&nbsp; "id[]":[1, 2]<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >}<br >例如<br >{<br > &nbsp;&nbsp; "Comment\[]":{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "count":2,<br > &nbsp;&nbsp;&nbsp;&nbsp; "id[]":\[1, 2]<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >}
PUT: <br > 修改数据,<br > 只修改所传的字段 | base_url/put/ | {<br > &nbsp;&nbsp; TableName:{<br > &nbsp;&nbsp;&nbsp;&nbsp; "id":id,<br > &nbsp;&nbsp;&nbsp;&nbsp;<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "tag":tag<br >} <br > {…} 中 id 或 id{} 至少传一个 <br ><br >例如修改 id = 235 的 Moment 的 content<br >{<br > &nbsp;&nbsp; "Moment":{<br > &nbsp;&nbsp;&nbsp;&nbsp; "id":235,<br > &nbsp;&nbsp;&nbsp;&nbsp; "content":"APIJSON,let interfaces and documents go to hell !"<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "tag":"Moment"<br >} <br > <br > 批量除了 id{}:\[] 也可类似批量 POST只是每个 {...} 里面都必须有 id | 同POST
DELETE: <br > 删除数据 | base_url/delete/ | {<br > &nbsp;&nbsp; TableName:{<br > &nbsp;&nbsp;&nbsp;&nbsp; "id":id<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "tag":tag<br >} <br > {…} 中 id 或 id{} 至少传一个,一般只传 id 或 id{} <br ><br >例如批量删除 id = 100,110,120 的 Comment<br >{<br > &nbsp;&nbsp; "Comment":{<br > &nbsp;&nbsp;&nbsp;&nbsp; "id{}":[100,110,120]<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "tag":"Comment[]"<br >} | {<br > &nbsp;&nbsp; TableName:{<br > &nbsp;&nbsp;&nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp;&nbsp;&nbsp; "msg":"success",<br > &nbsp;&nbsp;&nbsp;&nbsp; "id[]":[100,110,120]<br >&nbsp;&nbsp; &nbsp;&nbsp; "count":3<br > &nbsp;&nbsp; },<br > &nbsp;&nbsp; "code":200,<br > &nbsp;&nbsp; "msg":"success"<br >}<br >例如<br >{<br >&nbsp;&nbsp; "Comment":{<br >&nbsp;&nbsp; &nbsp;&nbsp; "code":200,<br >&nbsp;&nbsp; &nbsp;&nbsp; "msg":"success",<br >&nbsp;&nbsp; &nbsp;&nbsp; "id[]":[100,110,120],<br >&nbsp;&nbsp; &nbsp;&nbsp; "count":3<br >&nbsp;&nbsp; },<br >&nbsp;&nbsp; "code":200,<br >&nbsp;&nbsp; "msg":"success"<br >}