2016-11-24 23:36:31 +08:00
# APIJSON
2016-11-25 01:07:32 +08:00
2016-11-25 19:35:39 +08:00
A Functional JSON Structure Protocal.
2016-11-24 22:54:11 +08:00
2016-11-25 01:07:32 +08:00
You can set any JSON structure and your server will return a JSON String with the structure you had set like this:
2016-11-24 23:22:03 +08:00
2016-11-25 00:29:39 +08:00
## Request:
2016-11-25 00:31:01 +08:00
{< br / >
2016-11-25 00:29:39 +08:00
" []" : { //request an array< br / >
2016-11-24 23:36:07 +08:00
" page" : 1, //array condition< br / >
" count" : 2, < br / >
" User" : { //request an object form the table named User< br / >
2016-11-25 19:37:58 +08:00
" sex" : 0 //object condition< br / >
2016-11-24 23:36:07 +08:00
},< br / >
" work" : {< br / >
2016-11-25 00:29:39 +08:00
" userId" : “ /User/id” //rely path with default parent path,starts from the same level object' s path< br / >
2016-11-25 00:21:39 +08:00
},< br / >
2016-11-24 23:36:07 +08:00
" Comment[]" : { //request an array named Comment< br / >
" page" : 0,< br / >
" count" : 3,< br / >
" Comment" : {< br / >
" workId" : “ []/Work/id” //full rely path< br / >
}< br / >
2016-11-25 00:21:39 +08:00
}< br / >
2016-11-24 23:36:07 +08:00
}< br / >
}< / p >
2016-11-24 23:22:03 +08:00
2016-11-25 00:29:39 +08:00
## Response:
2016-11-25 00:31:01 +08:00
{< br / >
2016-11-24 23:36:07 +08:00
" []" :{< br / >
" 0" :{< br / >
" User" :{< br / >
" picture" :" " ,< br / >
" id" :" 38710" ,< br / >
" sex" :" 0" ,< br / >
" phone" :" 1300038710" ,< br / >
" name" :" Name-38710" ,< br / >
" head" :" http://www.tooopen.com/view/38710.html" < br / >
},< br / >
" Work" :{< br / >
" id" :470,< br / >
" title" :" Title-470" ,< br / >
" content" :" This is a Content...-470" ,< br / >
" userId" :38710,< br / >
" picture" :" http://www.tooopen.com/view/470.html" < br / >
},< br / >
" Comment[]" :{< br / >
" 0" :{< br / >
" Comment" :{< br / >
" id" :4,< br / >
" parentId" :0,< br / >
" workId" :470,< br / >
" userId" :310,< br / >
" targetUserId" :14604,< br / >
" content" :" This is a Content...-4" ,< br / >
" targetUserName" :" targetUserName-14604" ,< br / >
" userName" :" userName-93781" < br / >
}< br / >
},< br / >
" 1" :{< br / >
" Comment" :{< br / >
" id" :22,< br / >
" parentId" :221,< br / >
" workId" :470,< br / >
" userId" :332,< br / >
" targetUserId" :5904,< br / >
" content" :" This is a Content...-22" ,< br / >
" targetUserName" :" targetUserName-5904" ,< br / >
" userName" :" userName-11679" < br / >
}< br / >
},< br / >
" 2" :{< br / >
" Comment" :{< br / >
" id" :47,< br / >
" parentId" :4,< br / >
" workId" :470,< br / >
" userId" :10,< br / >
" targetUserId" :5477,< br / >
" content" :" This is a Content...-47" ,< br / >
" targetUserName" :" targetUserName-5477" ,< br / >
" userName" :" userName-80271" < br / >
}< br / >
}< br / >
}< br / >
},< br / >
" 1" :{< br / >
" User" :{< br / >
" picture" :" " ,< br / >
" id" :" 70793" ,< br / >
" sex" :" 0" ,< br / >
" phone" :" 1300070793" ,< br / >
" name" :" Name-70793" ,< br / >
" head" :" http://www.tooopen.com/view/70793.html" < br / >
},< br / >
" Work" :{< br / >
" id" :170,< br / >
" title" :" Title-73" ,< br / >
" content" :" This is a Content...-73" ,< br / >
" userId" :70793,< br / >
" picture" :" http://www.tooopen.com/view/73.html" < br / >
},< br / >
" Comment[]" :{< br / >
" 0" :{< br / >
" Comment" :{< br / >
" id" :44,< br / >
" parentId" :0,< br / >
" workId" :170,< br / >
" userId" :7073,< br / >
" targetUserId" :6378,< br / >
" content" :" This is a Content...-44" ,< br / >
" targetUserName" :" targetUserName-6378" ,< br / >
" userName" :" userName-88645" < br / >
}< br / >
},< br / >
" 1" :{< br / >
" Comment" :{< br / >
" id" :54,< br / >
" parentId" :0,< br / >
" workId" :170,< br / >
" userId" :3,< br / >
" targetUserId" :62122,< br / >
" content" :" This is a Content...-54" ,< br / >
" targetUserName" :" targetUserName-62122" ,< br / >
" userName" :" userName-82381" < br / >
}< br / >
},< br / >
" 2" :{< br / >
" Comment" :{< br / >
" id" :99,< br / >
" parentId" :44,< br / >
" workId" :170,< br / >
" userId" :793,< br / >
" targetUserId" :7166,< br / >
" content" :" This is a Content...-99" ,< br / >
" targetUserName" :" targetUserName-7166" ,< br / >
" userName" :" userName-22949" < br / >
}< br / >
}< br / >
}< br / >
}< br / >
}< br / >
}< / p >
2016-11-24 23:22:03 +08:00
2016-11-25 00:29:39 +08:00
2016-11-25 19:35:39 +08:00
![](https://github.com/TommyLemon/APIJSON/blob/master/picture/apijson_all_pages.jpg?raw=true)
![](https://github.com/TommyLemon/APIJSON/blob/master/picture/server_idea_log_complex.jpg)
![](https://github.com/TommyLemon/APIJSON/blob/master/picture/complex_json_cn.jpg?raw=true)
2016-11-25 01:07:32 +08:00
## Usage
### 1.Download and Unzip APIJSON project
Clone or download > Download ZIP > Unzip to a path and remember it.
### 2.Import MySQL table files
Start MySQLWorkbench > Enter a connection > Click Server menu > Data Import > Select download path< / p >
of APIJSON-Master/table > Start Import > refresh SCHEMAS, and you'll see the tables were already added.< / p >
### 3.Run Server project with IntellIJ IDEA
If you don't have installed it, please download and install before run.
### 4.Run Client project with ADT or Android Studio
If you don't have installed any editor above, please download and install before run.
### 5.Operate Client app
Select a json request to send to server and wait. It will show the result received.
2016-11-25 00:29:39 +08:00
## Welcome star, welcome fork
2016-11-25 01:07:32 +08:00
[https://github.com/TommyLemon/APIJSON ](https://github.com/TommyLemon/APIJSON )
2016-11-25 00:29:39 +08:00
2016-11-25 01:20:17 +08:00
## Download Client App
2016-11-25 00:29:39 +08:00
2016-11-25 01:20:17 +08:00
[APIJSONClientApp.apk ](http://files.cnblogs.com/files/tommylemon/APIJSON%28ADT%29.apk )
2016-11-25 00:29:39 +08:00
# APIJSON, let interfaces go to hell !