Commit 371fb05030d0eec933a4a19ab26109f71309b8be
1 parent
63266d27
update
Showing
2 changed files
with
2 additions
and
4 deletions
myapp-web/src/main/java/com/b2c/myapp/api/BuyerInfoApi.java
... | ... | @@ -117,8 +117,7 @@ public class BuyerInfoApi extends BaseRestFulApi { |
117 | 117 | BuyerInfoListInput buyerInfoListInput = new BuyerInfoListInput(); |
118 | 118 | buyerInfoListInput.setMobilePhone(mobilePhone); |
119 | 119 | List<BuyerInfo> buyerInfos = buyerInfoService.list(buyerInfoListInput); |
120 | - CommonUtils.throwDataError(CollectionUtils.isEmpty(buyerInfos),String.format("此手机号未注册:%s", mobilePhone)); | |
121 | - BuyerInfoOutput buyerInfoOutput = BeanConver.copeBean(buyerInfos.get(0),BuyerInfoOutput.class); | |
120 | + BuyerInfoOutput buyerInfoOutput = CollectionUtils.isEmpty(buyerInfos)?null:BeanConver.copeBean(buyerInfos.get(0),BuyerInfoOutput.class); | |
122 | 121 | output.setData(buyerInfoOutput); |
123 | 122 | } catch (Exception e) { |
124 | 123 | handleException(output, e); |
... | ... |
myapp-web/src/main/java/com/b2c/myapp/api/SellerInfoApi.java
... | ... | @@ -117,8 +117,7 @@ public class SellerInfoApi extends BaseRestFulApi { |
117 | 117 | SellerInfoListInput sellerInfoListInput = new SellerInfoListInput(); |
118 | 118 | sellerInfoListInput.setMobilePhone(mobilePhone); |
119 | 119 | List<SellerInfo> sellerInfos = sellerInfoService.list(sellerInfoListInput); |
120 | - CommonUtils.throwDataError(CollectionUtils.isEmpty(sellerInfos),String.format("此手机号未注册:%s", mobilePhone)); | |
121 | - SellerInfoOutput sellerInfoOutput = BeanConver.copeBean(sellerInfos.get(0),SellerInfoOutput.class); | |
120 | + SellerInfoOutput sellerInfoOutput = CollectionUtils.isEmpty(sellerInfos)?null: BeanConver.copeBean(sellerInfos.get(0),SellerInfoOutput.class); | |
122 | 121 | output.setData(sellerInfoOutput); |
123 | 122 | } catch (Exception e) { |
124 | 123 | handleException(output, e); |
... | ... |