Skip to content

Commit 476f6e2

Browse files
committed
优化文档
1 parent ecb9bb7 commit 476f6e2

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

Document-English.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Request:
55
<pre><code class="language-json">{
66
"User":{
7-
 }
7+
}
88
}
99
</code></pre>
1010

@@ -44,10 +44,10 @@ Response:
4444
Request:
4545
<pre><code class="language-json">{
4646
"[]":{
47-
  "count":3,             //just get 3 results
48-
  "User":{
49-
    "@column":"id,name" //just get ids and names
50-
  }
47+
"count":3, //just get 3 results
48+
"User":{
49+
"@column":"id,name" //just get ids and names
50+
}
5151
}
5252
}
5353
</code></pre>
@@ -134,13 +134,13 @@ Response:
134134
Request:
135135
<pre><code class="language-json">{
136136
"[]":{ //get an array
137-
"page":0,                     //pagination
137+
"page":0, //pagination
138138
"count":2,
139-
"Moment":{                     //get a Moment
140-
"content$":"%a%"          //filter condition: content contains 'a'
139+
"Moment":{ //get a Moment
140+
"content$":"%a%" //filter condition: content contains 'a'
141141
},
142142
"User":{
143-
    "id@":"/Moment/userId",       //User.id = Moment.userId, short reference path,starts from grandparents path
143+
"id@":"/Moment/userId", //User.id = Moment.userId, short reference path,starts from grandparents path
144144
"@column":"id,name,head" //get specified keys with the written order
145145
},
146146
"Comment[]":{ //get a Comment array, and unwrap Comment object
@@ -163,7 +163,7 @@ Response:
163163
"id":15,
164164
"userId":70793,
165165
"date":1486541171000,
166-
"content":"APIJSON is a JSON Transmission Structure Protocol…",
166+
"content":"APIJSON is a JSON Transmission Protocol…",
167167
"praiseUserIdList":[
168168
82055,
169169
82002,
@@ -288,14 +288,14 @@ Response:
288288

289289
### 1. Methods and API endpoints
290290

291-
 Methods | URL | Request | Response
291+
Methods | URL | Request | Response
292292
------------ | ------------ | ------------ | ------------
293-
**GET**: <br /> A general way to get data.<br /> You can use dev tools to make edits in a web browser. | base_url/get/ | {<br /> &nbsp;&nbsp; TableName:{<br /> &nbsp;&nbsp;&nbsp;&nbsp; //Add contiditions here.<br /> &nbsp;&nbsp; }<br />} <br /> <br /> Eg. To get a Moment with `id = 235`:<br />{<br /> &nbsp;&nbsp; "Moment":{<br /> &nbsp;&nbsp;&nbsp;&nbsp; "id":235<br /> &nbsp;&nbsp; }<br />} | {<br /> &nbsp;&nbsp; TableName:{<br /> &nbsp;&nbsp;&nbsp;&nbsp; ...<br /> &nbsp;&nbsp; },<br /> &nbsp;&nbsp; "code":200,<br /> &nbsp;&nbsp; "msg":"success"<br />}<br />Eg.<br />{<br /> &nbsp;&nbsp; "Moment":{<br /> &nbsp;&nbsp;&nbsp;&nbsp; "id":235,<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; "code":200,<br /> &nbsp;&nbsp; "msg":"success"<br /> }
293+
**GET**: <br /> A general way to get data.<br /> You can use dev tools to make edits in a web browser. | base_url/get/ | {<br /> &nbsp;&nbsp; TableName:{<br /> &nbsp;&nbsp;&nbsp;&nbsp; //Add contiditions here.<br /> &nbsp;&nbsp; }<br />} <br /> <br /> Eg. To get a Moment with `id = 235`:<br />{<br /> &nbsp;&nbsp; "Moment":{<br /> &nbsp;&nbsp;&nbsp;&nbsp; "id":235<br /> &nbsp;&nbsp; }<br />} | {<br /> &nbsp;&nbsp; TableName:{<br /> &nbsp;&nbsp;&nbsp;&nbsp; ...<br /> &nbsp;&nbsp; },<br /> &nbsp;&nbsp; "code":200,<br /> &nbsp;&nbsp; "msg":"success"<br />}<br />Eg.<br />{<br /> &nbsp;&nbsp; "Moment":{<br /> &nbsp;&nbsp;&nbsp;&nbsp; "id":235,<br /> &nbsp;&nbsp;&nbsp;&nbsp; "userId":38710,<br /> &nbsp;&nbsp;&nbsp;&nbsp; "content":"APIJSON is the real-time coding-free, powerful and secure ORM"<br /> &nbsp;&nbsp; },<br /> &nbsp;&nbsp; "code":200,<br /> &nbsp;&nbsp; "msg":"success"<br /> }
294294
**HEAD**: <br /> A general way to get counts.<br /> You can use dev tools to make edits in a web browser. | base_url/head/ | {<br /> &nbsp;&nbsp; TableName:{<br /> &nbsp;&nbsp;&nbsp;&nbsp; …<br /> &nbsp;&nbsp; }<br /> } <br /> {…} are conditions. <br /><br /> Eg. Get the number of Moments posted by the user with `id = 38710`:<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 /> Eg.<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 />}
295295
**GETS**: <br /> Get data with high security and confidentiality.<br /> Eg. bank accounts, birth date. | base_url/gets/ | You need to add `"tag":tag` with the same level of `Moment:{}`. Others are the same as **GET**. | Same as **GET**.
296296
**HEADS**: <br /> Get counts of confidential data(eg. bank account).| base_url/heads/ | You need to add `"tag":tag` with the same level of `Moment:{}`. Others are the same as **HEAD**. | Same as **HEAD**.
297-
**POST**: <br /> Add new data. | base_url/post/ | {<br /> &nbsp;&nbsp; TableName:{<br /> &nbsp;&nbsp;&nbsp;&nbsp; …<br /> &nbsp;&nbsp; },<br /> &nbsp;&nbsp; "tag":tag<br />} <br /> The id in {...} is generated automatically when table is built and can’t be set by the user. <br /><br />Eg. A user with `id = 38710` posts a new 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 /> &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 />Eg.<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 />}
298-
**PUT**: <br /> Make changes to a specific item.<br /> Only change the part sent to server. | 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 /> You can also add multiple id as `id{}`.<br /><br />Eg. Make changes to Moment's content with id= 235:<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 />} | Same as **POST**.
297+
**POST**: <br /> Add new data. | base_url/post/ | {<br /> &nbsp;&nbsp; TableName:{<br /> &nbsp;&nbsp;&nbsp;&nbsp; …<br /> &nbsp;&nbsp; },<br /> &nbsp;&nbsp; "tag":tag<br />} <br /> The id in {...} is generated automatically when table is built and can’t be set by the user. <br /><br />Eg. A user with `id = 38710` posts a new Moment:<br />{<br /> &nbsp;&nbsp; "Moment":{<br /> &nbsp;&nbsp;&nbsp;&nbsp; "userId":38710,<br /> &nbsp;&nbsp;&nbsp;&nbsp; "content":"APIJSON is the real-time coding-free, powerful and secure ORM"<br /> &nbsp;&nbsp; },<br /> &nbsp;&nbsp; "tag":"Moment"<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 />Eg.<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 />}
298+
**PUT**: <br /> Make changes to a specific item.<br /> Only change the part sent to server. | 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 /> You can also add multiple id as `id{}`.<br /><br />Eg. Make changes to Moment's content with id= 235:<br />{<br /> &nbsp;&nbsp; "Moment":{<br /> &nbsp;&nbsp;&nbsp;&nbsp; "id":235,<br /> &nbsp;&nbsp;&nbsp;&nbsp; "content":"APIJSON is the real-time coding-free, powerful and secure ORM"<br /> &nbsp;&nbsp; },<br /> &nbsp;&nbsp; "tag":"Moment"<br />} | Same as **POST**.
299299
**DELETE**: <br /> Delete data. | base_url/delete/ | {<br /> &nbsp;&nbsp; TableName:{<br /> &nbsp;&nbsp;&nbsp;&nbsp; "id":id<br /> &nbsp;&nbsp; },<br /> &nbsp;&nbsp; "tag":tag<br />} <br /> You can also add multiple id as `id{}`. <br /><br /> Or Delete contents with multiple id:<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 />Eg.<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 />}
300300

301301
**Note**:<br />

0 commit comments

Comments
 (0)