Skip to content

Commit fee0830

Browse files
committed
添加Wallet解析测试
1 parent 3c808c7 commit fee0830

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

APIJSON(Android)/APIJSON(ADT)/src/zuo/biao/apijson/client/model/Wallet.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
1+
/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)
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+
115
package zuo.biao.apijson.client.model;
216

17+
import java.math.BigDecimal;
18+
19+
/**钱包类
20+
* @author Lemon
21+
*/
322
public class Wallet extends BaseModel {
423
private static final long serialVersionUID = 4298571449155754300L;
524

6-
public Double balance;
25+
public BigDecimal balance;
726

827
public Long userId;
928

@@ -25,10 +44,10 @@ public Long getUserId() {
2544
return userId;
2645
}
2746

28-
public Double getBalance() {
47+
public BigDecimal getBalance() {
2948
return balance;
3049
}
31-
public void setBalance(Double balance) {
50+
public void setBalance(BigDecimal balance) {
3251
this.balance = balance;
3352
}
3453

APIJSON(Android)/APIJSON(ADT)/src/zuo/biao/apijson/client/ui/QueryActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import zuo.biao.apijson.client.RequestUtil;
3030
import zuo.biao.apijson.client.model.Comment;
3131
import zuo.biao.apijson.client.model.User;
32+
import zuo.biao.apijson.client.model.Wallet;
3233
import zuo.biao.apijson.client.model.Work;
3334
import android.app.Activity;
3435
import android.content.Context;
@@ -198,6 +199,10 @@ public void onHttpResponse(int requestCode, final String resultJson, final Excep
198199
Work work = JSONResponse.getObject(response, Work.class);
199200
Log.d(TAG, "onHttpResponse type == TYPE_COMPLEX >> work = " + JSON.toJSONString(work));
200201
logList(JSONResponse.getList(response == null ? null : response.getJSONObject("Comment[]"), Comment.class));
202+
} else if (type == TYPE_ACCESS_PERMITTED) {
203+
response = new JSONResponse(resultJson);
204+
Wallet wallet = JSONResponse.getObject(response, Wallet.class);
205+
Log.d(TAG, "onHttpResponse type == TYPE_ACCESS_PERMITTED >> wallet = " + JSON.toJSONString(wallet));
201206
}
202207

203208
runOnUiThread(new Runnable() {

0 commit comments

Comments
 (0)