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
Transmission | Server developers edit apis and update documents, then client developers request server and parse responses according to the documents | Client developers request server and parse responses for their requirements. No inteface! No document! No communication for any api or document between client and server developers!
295
297
Compatibility | Server developers add new apis tagged with v2 and update documents | Nothing need to do!
296
298
297
-
<br />
299
+
<br />
298
300
299
301
Client request | Previous way | APIJSON
300
302
-------- | ------------ | ------------
@@ -303,21 +305,21 @@ Response:
303
305
URL | Different urls for different requests. The more diffirent kinds of request, the more different urls | One url for one method(GET,POST...), most requests use the same URL of the 7 common ones
304
306
Key-Value Pair | key=value | key:value
305
307
306
-
<br />
308
+
<br />
307
309
308
310
Server operation | Previous way | APIJSON
309
311
-------- | ------------ | ------------
310
312
Parse and response | Get key-value pairs and query the database with them by the default way, then encapsulate a JSON, finally return the JSON to clients | Just return what Parser#parse returned
311
313
Way of setting JSON structure to return | Designed in servers and cannot be modified by any clients | Designed by clients and cannot be modified by servers
312
314
313
-
<br />
315
+
<br />
314
316
315
317
Client parse | Previous way | APIJSON
316
318
-------- | ------------ | ------------
317
319
View structure | Search documents or view logs after responses for requests | Just view the requests, and viewing logs after responses for requests is also supported
318
320
Operate | Parse JSON String from responses | Parse with JSONResponse or use previous way
319
321
320
-
<br />
322
+
<br />
321
323
322
324
Client requests | Previous way | APIJSON
323
325
-------- | ------------ | ------------
@@ -327,7 +329,7 @@ Response:
327
329
A list, each item contains<br /> a Moment, a publisher(User)<br /> and a list of top 3 Comments | The Moment must contains an User Object and a Comment Array<br /><br /> base_url/get/moment/list?<br />page=0&count=3&commentCount=3 | [base_url/get/<br >{<br > "[]":{<br > "page":0, <br > "count":3, <br > "Moment":{}, <br > "User":{<br > "id@":"/Moment/userId"<br > },<br > "Comment[]":{<br > "count":3,<br > "Comment":{<br > "momentId@":"[]/Moment/id"<br > }<br > }<br > }<br >}](http://139.196.140.118:8080/get/{"[]":{"page":0,"count":3,"Moment":{},"User":{"id@":"%252FMoment%252FuserId"},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
328
330
A list, each item contains<br /> a Moment, the same publisher(User)<br /> and a list of top 3 Comments | Each Moment must contains an User Object and a Comment Array <br /><br /> base_url/get/moment/list?<br />page=0&count=3<br />&commentCount=3&userId=38710 | Here are several ways:<br /> ① Change <br >"Moment":{}, "User":{"id@":"/Moment/userId"}<br > to <br >["Moment":{"userId":38710}, "User":{"id":38710}](http://139.196.140.118:8080/get/{"[]":{"page":0,"count":3,"Moment":{"userId":38710},"User":{"id":38710},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}}) <br /><br /> ② Or save repeated Users by this way<br />[base_url/get/<br >{<br > "User":{<br > "id":38710<br > },<br > "[]":{<br > "page":0,<br > "count":3, <br > "Moment":{<br > "userId":38710<br > }, <br > "Comment[]":{<br > "count":3,<br > "Comment":{<br > "momentId@":"[]/Moment/id"<br > }<br > }<br > }<br >}](http://139.196.140.118:8080/get/{"User":{"id":38710},"[]":{"page":0,"count":3,"Moment":{"userId":38710},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})<br /><br /> ③ If the User is already obtained, you can also save all repeated User by this way<br />[base_url/get/<br >{<br > "[]":{<br > "page":0,<br > "count":3, <br > "Moment":{<br > "userId":38710<br > },<br > "Comment[]":{<br > "count":3,<br > "Comment":{<br > "momentId@":"[]/Moment/id"<br > }<br > }<br > }<br >}](http://139.196.140.118:8080/get/{"[]":{"page":0,"count":3,"Moment":{"userId":38710},"Comment[]":{"count":3,"Comment":{"momentId@":"[]%252FMoment%252Fid"}}}})
0 commit comments