Skip to content

Commit 2141152

Browse files
committed
新增1.6.0版测试APP; Client:Test删除Wallet,新增Privacy;
1 parent d8699e5 commit 2141152

File tree

6 files changed

+105
-112
lines changed

6 files changed

+105
-112
lines changed

APIJSON-Android/APIJSON-ADT/APIJSONTest/src/apijson/demo/RequestUtil.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import apijson.demo.application.DemoApplication;
2424
import apijson.demo.model.Comment;
2525
import apijson.demo.model.Moment;
26+
import apijson.demo.model.Privacy;
2627
import apijson.demo.model.User;
27-
import apijson.demo.model.Wallet;
2828

2929
/**请求工具类
3030
* @author Lemon
@@ -113,16 +113,12 @@ public static JSONObject newComplexRequest() {
113113
}
114114

115115
public static JSONObject newAccessErrorRequest() {
116-
return new JSONRequest(new Wallet().setUserId(DEFAULT_USER_ID))
117-
.setTag(Wallet.class.getSimpleName());
116+
return new JSONRequest(new Privacy(DEFAULT_USER_ID));
118117
}
119118

120119
public static JSONObject newAccessPermittedRequest() {
121-
JSONRequest request = new JSONRequest();
122-
request.put(new Wallet().setUserId(DEFAULT_USER_ID));
123-
request.put("currentUserId", DEFAULT_USER_ID);
124-
request.put("loginPassword", "apijson");
125-
return request.setTag(Wallet.class.getSimpleName());
120+
JSONRequest request = new JSONRequest(new Privacy(DEFAULT_USER_ID));
121+
return request.setTag(Privacy.class.getSimpleName());
126122
}
127123

128124
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*Copyright ©2016 TommyLemon(https://github.com/TommyLemon/APIJSON)
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.*/
14+
15+
package apijson.demo.model;
16+
17+
import static zuo.biao.apijson.RequestRole.ADMIN;
18+
import static zuo.biao.apijson.RequestRole.OWNER;
19+
import static zuo.biao.apijson.RequestRole.UNKNOWN;
20+
21+
import zuo.biao.apijson.MethodAccess;
22+
23+
/**用户隐私信息
24+
* @author Lemon
25+
*/
26+
@MethodAccess(
27+
GET = {},
28+
POST_GET = {OWNER, ADMIN},
29+
POST = {UNKNOWN, ADMIN},
30+
DELETE = {ADMIN}
31+
)
32+
public class Privacy extends BaseModel {
33+
private static final long serialVersionUID = 1L;
34+
35+
public static final int PASSWORD_TYPE_LOGIN = 0;
36+
public static final int PASSWORD_TYPE_PAY = 1;
37+
38+
private String phone; //手机
39+
private String password; //登录密码,隐藏字段
40+
private String payPassword; //支付密码,隐藏字段
41+
private Double balance; //余额
42+
43+
public Privacy() {
44+
super();
45+
}
46+
47+
public Privacy(long id) {
48+
this();
49+
setId(id);
50+
}
51+
52+
public Privacy(String phone, String password) {
53+
this();
54+
setPhone(phone);
55+
setPassword(password);
56+
}
57+
58+
59+
60+
public String getPhone() {
61+
return phone;
62+
}
63+
public Privacy setPhone(String phone) {
64+
this.phone = phone;
65+
return this;
66+
}
67+
68+
/**get_password会转为password
69+
* @return
70+
*/
71+
public String get__password() {
72+
return password;
73+
}
74+
public Privacy setPassword(String password) {
75+
this.password = password;
76+
return this;
77+
}
78+
79+
/**get_PayPassword会转为PayPassword
80+
* @return
81+
*/
82+
public String get__payPassword() {
83+
return payPassword;
84+
}
85+
public Privacy setPayPassword(String payPassword) {
86+
this.payPassword = payPassword;
87+
return this;
88+
}
89+
90+
public Double getBalance() {
91+
return balance;
92+
}
93+
public Privacy setBalance(Double balance) {
94+
this.balance = balance;
95+
return this;
96+
}
97+
98+
}

APIJSON-Android/APIJSON-ADT/APIJSONTest/src/apijson/demo/model/Wallet.java

Lines changed: 0 additions & 101 deletions
This file was deleted.

APIJSON-Android/APIJSON-ADT/APIJSONTest/src/apijson/demo/ui/RequestActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import apijson.demo.StringUtil;
4242
import apijson.demo.model.BaseModel;
4343
import apijson.demo.model.Moment;
44-
import apijson.demo.model.Wallet;
44+
import apijson.demo.model.Privacy;
4545

4646
import com.alibaba.fastjson.JSONObject;
4747

@@ -230,8 +230,8 @@ public void onHttpResponse(int requestCode, final String resultJson, final Excep
230230
+ "; isSucceed = " + JSONResponse.isSuccess(response));
231231

232232
} else if ("post_get".equals(method)) {
233-
Wallet wallet = response.getObject(Wallet.class);
234-
Log.d(TAG, "onHttpResponse post_get.equals(method) >> wallet = " + JSON.toJSONString(wallet));
233+
Privacy privacy = response.getObject(Privacy.class);
234+
Log.d(TAG, "onHttpResponse post_get.equals(method) >> privacy = \n" + JSON.toJSONString(privacy));
235235
}
236236

237237

APIJSONApp1.6.0.apk

1.42 MB
Binary file not shown.

APIJSONTest1.6.0.apk

391 KB
Binary file not shown.

0 commit comments

Comments
 (0)