Skip to content

Commit 1db30b9

Browse files
committed
Server:替换table;Client:同步adt版至studio版
1 parent 6a2aa0f commit 1db30b9

File tree

15 files changed

+268
-51
lines changed

15 files changed

+268
-51
lines changed

APIJSON(Android)/APIJSON(AndroidStudio)/.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

APIJSON(Android)/APIJSON(AndroidStudio)/app/src/main/java/apijson/demo/RequestUtil.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import java.util.ArrayList;
1818
import java.util.List;
1919

20-
import zuo.biao.apijson.JSON;
2120
import zuo.biao.apijson.client.JSONObject;
2221
import zuo.biao.apijson.client.JSONRequest;
2322
import apijson.demo.model.Comment;
@@ -49,19 +48,19 @@ public static JSONObject newPutRequest(long id) {
4948
List<String> list = new ArrayList<String>();
5049
list.add("http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000");
5150
list.add("http://common.cnblogs.com/images/icon_weibo_24.png");
52-
data.setPicture(JSON.toJSONString(list));//"\"" + JSON.toJSONString(new JSONObject("{\"id\":2}")) + "\"");//
51+
data.setPictureList(list);
5352

5453
return new JSONRequest(data).setTag(User.class.getSimpleName());
5554
}
56-
55+
5756
public static JSONObject newDeleteRequest(long id) {
5857
// 测试necessaryColumns = [id]通过
5958
// 测试对象不存在通过,存在返回success通过
6059
return new JSONRequest(new User(id <= 0 ? 10000 : id)).setTag(User.class.getSimpleName());//;// 测试必须指定tag通过
6160
}
6261

63-
64-
62+
63+
6564

6665
public static JSONObject newSingleRequest(long id) {
6766
return new JSONRequest(new User(id <= 0 ? 38710 : id));
@@ -96,15 +95,15 @@ public static JSONObject newComplexRequest() {
9695
}
9796

9897
public static JSONObject newAccessErrorRequest(long id) {
99-
return new JSONRequest(new Wallet().setUserId(id <= 0 ? 38710 : id));
98+
return new JSONRequest(new Wallet().setUserId(id <= 0 ? 38710 : id)).setTag(Wallet.class.getSimpleName());
10099
}
101100

102101
public static JSONObject newAccessPermittedRequest(long id) {
103102
JSONRequest request = new JSONRequest();
104103
request.put(new Wallet().setUserId(id <= 0 ? 38710 : id));
105104
request.put("currentUserId", 38710);
106-
request.put("payPassword", "123456");
107-
return request;
105+
request.put("loginPassword", "apijson");
106+
return request.setTag(Wallet.class.getSimpleName());
108107
}
109108

110109
}

APIJSON(Android)/APIJSON(AndroidStudio)/app/src/main/java/apijson/demo/model/User.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
package apijson.demo.model;
1616

17+
import java.util.List;
18+
1719
/**用户类
1820
* @author Lemon
1921
*/
@@ -24,7 +26,7 @@ public class User extends BaseModel {
2426
public String head;
2527
public String name;
2628
public String phone;
27-
public String picture;
29+
public List<String> pictureList;
2830

2931
/**默认构造方法,JSON等解析时必须要有
3032
*/
@@ -65,20 +67,10 @@ public String getPhone() {
6567
public void setPhone(String phone) {
6668
this.phone = phone;
6769
}
68-
public String getPicture() {
69-
return picture;
70+
public List<String> getPictureList() {
71+
return pictureList;
7072
}
71-
public void setPicture(String picture) {
72-
this.picture = picture;
73+
public void setPictureList(List<String> pictureList) {
74+
this.pictureList = pictureList;
7375
}
74-
75-
//// @Override
76-
//// public boolean isCorrect() {//根据自己的需求决定,也可以直接 return true
77-
//// return id != null && id > 0;// && StringUtil.isNotEmpty(phone, true);
78-
//// }
79-
//
80-
// @Override
81-
// public JSONObject toJSONObject() {
82-
// return toJSONObject(this);
83-
// }
8476
}

APIJSON(Android)/APIJSON(AndroidStudio)/app/src/main/java/apijson/demo/ui/QueryActivity.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public static Intent createIntent(Context context, int type, String url, long id
8888
public static final int TYPE_RELY = 12;
8989
public static final int TYPE_ARRAY = 13;
9090
public static final int TYPE_COMPLEX = 14;
91-
public static final int TYPE_ACCESS_ERROR = 15;
92-
public static final int TYPE_ACCESS_PERMITTED = 16;
91+
public static final int TYPE_ACCESS_ERROR = 5;
92+
public static final int TYPE_ACCESS_PERMITTED = 6;
9393

9494

9595

@@ -217,6 +217,9 @@ private String getMethod(int type) {
217217
return "put";
218218
case TYPE_DELETE:
219219
return "delete";
220+
case TYPE_ACCESS_ERROR:
221+
case TYPE_ACCESS_PERMITTED:
222+
return "post_get";
220223
default:
221224
return "get";
222225
}

APIJSON(Android)/APIJSON(AndroidStudio)/app/src/main/res/layout/query_activity.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
<Button
4545
android:id="@+id/btnQueryQuery"
46-
android:layout_width="90dp"
46+
android:layout_width="wrap_content"
4747
android:layout_height="match_parent"
4848
android:text="Query" />
4949
</LinearLayout>

APIJSON(Android)/APIJSON(AndroidStudio)/app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<string name="app_name">APIJSON</string>
55
<string name="app_version">1.0</string>
66
<string name="demo_post">{\n&#160;&#160;&#160;\"tag\":\"User\",\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"name\":\"Tommy\",\n&#160;&#160;&#160;&#160;&#160;&#160;\"sex\":0,\n&#160;&#160;&#160;&#160;&#160;&#160;\"phone\":\"1234567890\"\n&#160;&#160;&#160;}\n}</string>
7-
<string name="demo_put">{\n&#160;&#160;&#160;\"tag\":\"User\",\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":38710,\n&#160;&#160;&#160;&#160;&#160;&#160;\"name\":\"Lemon\",\n&#160;&#160;&#160;&#160;&#160;&#160;\"picture\":\"[\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\", \"http://common.cnblogs.com/images/icon_weibo_24.png\"]\"\n&#160;&#160;&#160;}\n}</string>
7+
<string name="demo_put">{\n&#160;&#160;&#160;\"tag\":\"User\",\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":38710,\n&#160;&#160;&#160;&#160;&#160;&#160;\"name\":\"Lemon\",\n&#160;&#160;&#160;&#160;&#160;&#160;\"pictureList\":[\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\", \"http://common.cnblogs.com/images/icon_weibo_24.png\"]\n&#160;&#160;&#160;}\n}</string>
88
<string name="demo_delete">{\n&#160;&#160;&#160;\"tag\":\"User\",\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":10000\n&#160;&#160;&#160;}\n}</string>
99
<string name="demo_single">{\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":38710\n&#160;&#160;&#160;}\n}</string>
1010
<string name="demo_columns">{\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"columns\":\"id,name,phone\",\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":38710\n&#160;&#160;&#160;}\n}</string>

table/sys_Comment.sql

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ DROP TABLE IF EXISTS `Comment`;
2323
/*!40101 SET @saved_cs_client = @@character_set_client */;
2424
/*!40101 SET character_set_client = utf8 */;
2525
CREATE TABLE `Comment` (
26-
`id` bigint(20) NOT NULL,
27-
`parentId` int(5) NOT NULL,
28-
`workId` int(5) NOT NULL,
29-
`userId` int(5) NOT NULL,
30-
`targetUserId` int(5) NOT NULL,
26+
`id` bigint(15) NOT NULL,
27+
`parentId` bigint(15) NOT NULL,
28+
`momentId` bigint(15) NOT NULL,
29+
`userId` bigint(15) NOT NULL,
30+
`toUserId` bigint(15) NOT NULL,
3131
`content` varchar(1000) DEFAULT NULL,
32-
`targetUserName` varchar(20) NOT NULL,
33-
`userName` varchar(20) NOT NULL,
34-
`title` varchar(60) DEFAULT NULL,
32+
`date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
33+
`workId` bigint(15) NOT NULL COMMENT '兼容测试以前的Work(被Moment替代)',
3534
PRIMARY KEY (`id`)
3635
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3736
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -42,7 +41,7 @@ CREATE TABLE `Comment` (
4241

4342
LOCK TABLES `Comment` WRITE;
4443
/*!40000 ALTER TABLE `Comment` DISABLE KEYS */;
45-
INSERT INTO `Comment` VALUES (3,0,371,82002,59960,'This is a Content...-3','targetUserName-59960','userName-85560',NULL),(4,0,470,310,14604,'This is a Content...-4','targetUserName-14604','userName-93781',NULL),(13,0,58,64,6914,'This is a Content...-13','targetUserName-6914','userName-70118',NULL),(22,221,470,332,5904,'This is a Content...-22','targetUserName-5904','userName-11679',NULL),(44,0,170,7073,6378,'This is a Content...-44','targetUserName-6378','userName-88645',NULL),(45,0,301,93793,99700,'This is a Content...-45','targetUserName-99700','userName-30075',NULL),(47,4,470,10,5477,'This is a Content...-47','targetUserName-5477','userName-80271',NULL),(51,45,301,903,8711,'This is a Content...-51','targetUserName-8711','userName-97675',NULL),(54,0,170,3,62122,'This is a Content...-54','targetUserName-62122','userName-82381',NULL),(68,0,371,2314,959,'This is a Content...-68','targetUserName-959','userName-92565',NULL),(76,45,301,93793,42688,'This is a Content...-76','targetUserName-42688','userName-20740',NULL),(77,13,58,90814,35234,'This is a Content...-77','targetUserName-35234','userName-94888',NULL),(97,13,58,90814,14326,'This is a Content...-97','targetUserName-14326','userName-6289',NULL),(99,44,170,793,7166,'This is a Content...-99','targetUserName-7166','userName-22949',NULL),(157,0,371,34,7162,'This is a Content...-13','targetUserName-7162','userName-5526',NULL);
44+
INSERT INTO `Comment` VALUES (3,0,371,82002,59960,'This is a Content...-3','2017-02-01 11:20:50',371),(4,0,470,38710,82002,'This is a Content...-4','2017-02-01 11:20:50',470),(13,0,58,82005,93793,'This is a Content...-13','2017-02-01 11:20:50',58),(22,221,470,82001,70793,'This is a Content...-22','2017-02-01 11:20:50',470),(44,0,170,82003,93793,'This is a Content...-44','2017-02-01 11:20:50',170),(45,0,301,93793,99700,'This is a Content...-45','2017-02-01 11:20:50',301),(47,4,470,70793,70793,'This is a Content...-47','2017-02-01 11:20:50',470),(51,45,301,82003,70793,'This is a Content...-51','2017-02-01 11:20:50',301),(54,0,170,82004,93793,'This is a Content...-54','2017-02-01 11:20:50',170),(68,0,371,82005,70793,'This is a Content...-68','2017-02-01 11:20:50',371),(76,45,301,93793,70793,'This is a Content...-76','2017-02-01 11:20:50',301),(77,13,58,93793,35234,'This is a Content...-77','2017-02-01 11:20:50',58),(97,13,58,82006,14326,'This is a Content...-97','2017-02-01 11:20:50',58),(99,44,170,70793,7166,'This is a Content...-99','2017-02-01 11:20:50',170),(157,0,371,93793,70793,'This is a Content...-13','2017-02-01 11:20:50',371);
4645
/*!40000 ALTER TABLE `Comment` ENABLE KEYS */;
4746
UNLOCK TABLES;
4847
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -55,4 +54,4 @@ UNLOCK TABLES;
5554
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
5655
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
5756

58-
-- Dump completed on 2017-01-24 16:19:11
57+
-- Dump completed on 2017-03-01 12:33:40

table/sys_Login.sql

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
-- MySQL dump 10.13 Distrib 5.7.12, for osx10.9 (x86_64)
2+
--
3+
-- Host: localhost Database: sys
4+
-- ------------------------------------------------------
5+
-- Server version 5.7.16
6+
7+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10+
/*!40101 SET NAMES utf8 */;
11+
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12+
/*!40103 SET TIME_ZONE='+00:00' */;
13+
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15+
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17+
18+
--
19+
-- Table structure for table `Login`
20+
--
21+
22+
DROP TABLE IF EXISTS `Login`;
23+
/*!40101 SET @saved_cs_client = @@character_set_client */;
24+
/*!40101 SET character_set_client = utf8 */;
25+
CREATE TABLE `Login` (
26+
`id` bigint(10) NOT NULL AUTO_INCREMENT,
27+
`userId` bigint(15) NOT NULL,
28+
`type` tinyint(2) NOT NULL,
29+
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
30+
PRIMARY KEY (`id`)
31+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
32+
/*!40101 SET character_set_client = @saved_cs_client */;
33+
34+
--
35+
-- Dumping data for table `Login`
36+
--
37+
38+
LOCK TABLES `Login` WRITE;
39+
/*!40000 ALTER TABLE `Login` DISABLE KEYS */;
40+
/*!40000 ALTER TABLE `Login` ENABLE KEYS */;
41+
UNLOCK TABLES;
42+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
43+
44+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
45+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
46+
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
47+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
48+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
49+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
50+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
51+
52+
-- Dump completed on 2017-03-01 12:33:41

0 commit comments

Comments
 (0)