Commit acd4f6025f61352d26426b7c24e3dc0294858962
1 parent
751bbbe9
http-request update
Showing
2 changed files
with
14 additions
and
2 deletions
myapp-sdk/src/main/java/com/b2c/myapp/sdk/service/impl/BaseServiceImpl.java
... | ... | @@ -49,7 +49,10 @@ import java.util.Map; |
49 | 49 | for (int i = 0; i < descriptors.length; i++) { |
50 | 50 | String name = descriptors[i].getName(); |
51 | 51 | if (!"class".equals(name)) { |
52 | - params.put(name, propertyUtilsBean.getNestedProperty(obj, name)); | |
52 | + Object value = propertyUtilsBean.getNestedProperty(obj, name); | |
53 | + if(null != value){ | |
54 | + params.put(name, value); | |
55 | + } | |
53 | 56 | } |
54 | 57 | } |
55 | 58 | } catch (Exception e) { |
... | ... |
myapp-sdk/src/test/java/com/b2c/myapp/sdk/test/BuyerInfoServiceTest.java
... | ... | @@ -2,6 +2,7 @@ package com.b2c.myapp.sdk.test; |
2 | 2 | |
3 | 3 | import com.b2c.myapp.common.api.buyerInfo.input.BuyerInfoInput; |
4 | 4 | import com.b2c.myapp.common.api.buyerInfo.input.BuyerInfoListInput; |
5 | +import com.b2c.myapp.common.api.buyerInfo.input.BuyerInfoSaveInput; | |
5 | 6 | import com.b2c.myapp.common.api.buyerInfo.output.BuyerInfoOutput; |
6 | 7 | import com.b2c.myapp.common.utils.BaseOutput; |
7 | 8 | import com.b2c.myapp.common.utils.base.Page; |
... | ... | @@ -9,6 +10,8 @@ import com.b2c.myapp.sdk.service.BuyerInfoService; |
9 | 10 | import com.b2c.myapp.sdk.service.impl.BuyerInfoServiceImpl; |
10 | 11 | import org.junit.Test; |
11 | 12 | |
13 | +import java.util.List; | |
14 | + | |
12 | 15 | /** |
13 | 16 | * Created by jiangchengyong on 2016/11/28. |
14 | 17 | */ |
... | ... | @@ -19,8 +22,14 @@ public class BuyerInfoServiceTest { |
19 | 22 | public void list(){ |
20 | 23 | // BuyerInfoListInput buyerInfoInput = new BuyerInfoListInput(); |
21 | 24 | // buyerInfoInput.setId(1l); |
22 | -// BaseOutput<Page<BuyerInfoOutput>> output = buyerInfoService.list(buyerInfoInput); | |
25 | +// BaseOutput<List<BuyerInfoOutput>> output = buyerInfoService.listByCondition(buyerInfoInput); | |
23 | 26 | // System.out.println(output); |
27 | + | |
28 | + BuyerInfoSaveInput buyerInfoSaveInput = new BuyerInfoSaveInput(); | |
29 | + buyerInfoSaveInput.setMobilePhone("13558720641"); | |
30 | + buyerInfoSaveInput.setAccountName("jcy001"); | |
31 | + BaseOutput<BuyerInfoOutput> output = buyerInfoService.register(buyerInfoSaveInput); | |
32 | + System.out.println(output); | |
24 | 33 | } |
25 | 34 | |
26 | 35 | |
... | ... |