You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README(English).md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,14 +30,14 @@ Here is an example(Request an Moment list like Wechat friend circle data):
30
30
"User": { //request an object from the table named User<br />
"userId@": “/User/id” //rely path with default parent path,starts from the same level object's path<br />
35
35
},<br />
36
36
"Comment[]": { //request an array named Comment <br />
"content":"This is a Content...-99",<br />
@@ -202,18 +202,18 @@ Here is an example(Request an Moment list like Wechat friend circle data):
202
202
Client requests for different requirements | Previous way | APIJSON
203
203
-------- | ------------ | ------------
204
204
User | http://localhost:8080/get/user?id=1 | http://localhost:8080/get/{"User":{"id":1}}
205
-
User and his Work | Request twice<br />User: http://localhost:8080/get/user?id=1<br />Work: http://localhost:8080/get/work?userId=1 | http://localhost:8080/get/{"User":{"id":1}, "Work":{"userId@":"User/id"}}
205
+
User and his Moment | Request twice<br />User: http://localhost:8080/get/user?id=1<br />Moment: http://localhost:8080/get/work?userId=1 | http://localhost:8080/get/{"User":{"id":1}, "Moment":{"userId@":"User/id"}}
206
206
User list | http://localhost:8080/get/user/list?page=1&count=5&sex=0 | http://localhost:8080/get/{"[]":{"page":1, "count":5, "User":{"sex":0}}}
207
-
Work list of which type is 1, each Work contains it's publisher User and top 3 Comments | The Work must contains the User Object and Comment Array<br /> http://localhost:8080/get/work/list?page=1&count=5&type=1&commentCount=3 | http://localhost:8080/get/{"[]":{"page":1, "count":5, "Work":{"type":1}, "User":{"workId@":"/Work/id"}, "[]":{"count":3, "Comment":{"workId@":"[]/Work/id"}}}}
208
-
Work list of an User, each Work contains the publisher User and top 3 Comments | Change type=1 to userId=1 above | Here are several ways:<br />①Change "Work":{"type":1}, "User":{"workId@":"/Work/id"} to "User":{"id":1}, "Work":{"userId@":"/User/id"} above<br /><br />②Or save 4 repeated User by this way<br />http://localhost:8080/get/{"User":{"id":1}, "[]":{"page":1, "count":5, "Work":{"userId@":"User/id"}, "[]":{"count":3, "Comment":{"workId@":"[]/Work/id"}}}}<br /><br />③If the User is already obtained, you can also save all repeated User by this way<br />http://localhost:8080/get/{"[]":{"page":1, "count":5, "Work":{"userId":1}, "[]":{"count":3, "Comment":{"workId@":"[]/Work/id"}}}}
207
+
Moment list of which type is 1, each Moment contains it's publisher User and top 3 Comments | The Moment must contains the User Object and Comment Array<br /> http://localhost:8080/get/work/list?page=1&count=5&type=1&commentCount=3 | http://localhost:8080/get/{"[]":{"page":1, "count":5, "Moment":{"type":1}, "User":{"momentId@":"/Moment/id"}, "[]":{"count":3, "Comment":{"momentId@":"[]/Moment/id"}}}}
208
+
Moment list of an User, each Moment contains the publisher User and top 3 Comments | Change type=1 to userId=1 above | Here are several ways:<br />①Change "Moment":{"type":1}, "User":{"momentId@":"/Moment/id"} to "User":{"id":1}, "Moment":{"userId@":"/User/id"} above<br /><br />②Or save 4 repeated User by this way<br />http://localhost:8080/get/{"User":{"id":1}, "[]":{"page":1, "count":5, "Moment":{"userId@":"User/id"}, "[]":{"count":3, "Comment":{"momentId@":"[]/Moment/id"}}}}<br /><br />③If the User is already obtained, you can also save all repeated User by this way<br />http://localhost:8080/get/{"[]":{"page":1, "count":5, "Moment":{"userId":1}, "[]":{"count":3, "Comment":{"momentId@":"[]/Moment/id"}}}}
209
209
210
210
Server responses for different requests | Previous way | APIJSON
User and his Work | Reponse twice<br />User: {"status":200, "message":"success", "data":{"id":1, "name":"xxx"...}}<br />Work: {"status":200, "message":"success", "data":{"id":1, "name":"xxx"...}} | {"status":200, "message":"success", "User":{"id":1, "name":"xxx"...}, "Work":{"id":1, "content":"xxx"...}}
213
+
User and his Moment | Reponse twice<br />User: {"status":200, "message":"success", "data":{"id":1, "name":"xxx"...}}<br />Moment: {"status":200, "message":"success", "data":{"id":1, "name":"xxx"...}} | {"status":200, "message":"success", "User":{"id":1, "name":"xxx"...}, "Moment":{"id":1, "content":"xxx"...}}
214
214
User list | {"status":200, "message":"success", "data":[{"id":1, "name":"xxx"...}, {"id":2...}...]} | {"status":200, "message":"success", "[]":{"0":{"User":{"id":1, "name":"xxx"...}}, "1":{"User":{"id":2...}}...}}
215
-
Work list of which type is 1, each Work contains it's publisher User and top 3 Comments | {"status":200, "message":"success", "data":[{"id":1, "content":"xxx"..., "User":{...}, "Comment":[...]}, {"id":2...}...]} | {"status":200, "message":"success", "[]":{"0":{"Work":{"id":1, "content":"xxx"...}, "User":{...}, "[]":{"0":{"Comment":{...}...}}}, "1":{...}...}}
216
-
Work list of an User, each Work contains the publisher User and top 3 Comments | {"status":200, "message":"success", "data":[{"id":1, "content":"xxx"..., "User":{...}, "Comment":[...]}, {"id":2...}...]} | Results for the ways above:<br />①{"status":200, "message":"success", "[]":{"0":{"User":{"id":1, "name":"xxx"...}, "Work":{...}, "[]":{"0":{"Comment":{...}...}}}, "1":{...}...}}<br /><br />②{"status":200, "message":"success", "User":{...}, "[]":{"0":{"Work":{"id":1, "content":"xxx"...}, "[]":{"0":{"Comment":{...}...}}}, "1":{...}...}}<br /><br />③{"status":200, "message":"success", "[]":{"0":{"Work":{"id":1, "content":"xxx"...}, "[]":{"0":{"Comment":{...}...}}}, "1":{...}...}}
215
+
Moment list of which type is 1, each Moment contains it's publisher User and top 3 Comments | {"status":200, "message":"success", "data":[{"id":1, "content":"xxx"..., "User":{...}, "Comment":[...]}, {"id":2...}...]} | {"status":200, "message":"success", "[]":{"0":{"Moment":{"id":1, "content":"xxx"...}, "User":{...}, "[]":{"0":{"Comment":{...}...}}}, "1":{...}...}}
216
+
Moment list of an User, each Moment contains the publisher User and top 3 Comments | {"status":200, "message":"success", "data":[{"id":1, "content":"xxx"..., "User":{...}, "Comment":[...]}, {"id":2...}...]} | Results for the ways above:<br />①{"status":200, "message":"success", "[]":{"0":{"User":{"id":1, "name":"xxx"...}, "Moment":{...}, "[]":{"0":{"Comment":{...}...}}}, "1":{...}...}}<br /><br />②{"status":200, "message":"success", "User":{...}, "[]":{"0":{"Moment":{"id":1, "content":"xxx"...}, "[]":{"0":{"Comment":{...}...}}}, "1":{...}...}}<br /><br />③{"status":200, "message":"success", "[]":{"0":{"Moment":{"id":1, "content":"xxx"...}, "[]":{"0":{"Comment":{...}...}}}, "1":{...}...}}
0 commit comments