Commit ff8e5911d5cd25fb5f34881407337ce2af3bb913
1 parent
2765bc38
店铺 资金相关接口 update
Showing
2 changed files
with
66 additions
and
8 deletions
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/ShopBuyerRPCImpl.java
... | ... | @@ -10,13 +10,14 @@ import com.b2c.myapp.sdk.MyAppClient; |
10 | 10 | import com.diligrp.mobsite.getway.domain.except.ServiceException; |
11 | 11 | import com.diligrp.mobsite.getway.rpc.ShopBuyerRPC; |
12 | 12 | import org.apache.log4j.Logger; |
13 | +import org.springframework.stereotype.Service; | |
13 | 14 | |
14 | 15 | import javax.annotation.Resource; |
15 | -import java.util.List; | |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Created by jiangchengyong on 2017/1/10. |
19 | 19 | */ |
20 | +@Service | |
20 | 21 | public class ShopBuyerRPCImpl implements ShopBuyerRPC { |
21 | 22 | private final static Logger log = Logger.getLogger(ShopBuyerRPCImpl.class); |
22 | 23 | @Resource | ... | ... |
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/ShopRPCImpl.java
... | ... | @@ -4,6 +4,10 @@ import com.b2c.myapp.common.api.shop.input.ShopListInput; |
4 | 4 | import com.b2c.myapp.common.api.shop.input.ShopSaveInput; |
5 | 5 | import com.b2c.myapp.common.api.shop.input.ShopUpdateInput; |
6 | 6 | import com.b2c.myapp.common.api.shop.output.ShopOutput; |
7 | +import com.b2c.myapp.common.utils.BaseOutput; | |
8 | +import com.b2c.myapp.sdk.MyAppClient; | |
9 | +import com.diligrp.mobsite.getway.domain.common.ResultCode; | |
10 | +import com.diligrp.mobsite.getway.domain.except.ServiceException; | |
7 | 11 | import com.diligrp.mobsite.getway.domain.protocol.ProductCategory; |
8 | 12 | import com.diligrp.mobsite.getway.domain.protocol.ShopIntroduction; |
9 | 13 | import com.diligrp.mobsite.getway.domain.protocol.shop.model.ShopInfo; |
... | ... | @@ -12,6 +16,7 @@ import org.slf4j.Logger; |
12 | 16 | import org.slf4j.LoggerFactory; |
13 | 17 | import org.springframework.stereotype.Service; |
14 | 18 | |
19 | +import javax.annotation.Resource; | |
15 | 20 | import java.util.List; |
16 | 21 | |
17 | 22 | /** |
... | ... | @@ -19,23 +24,35 @@ import java.util.List; |
19 | 24 | * <B>Copyright</B> Copyright (c) 2015 www.diligrp.com All rights reserved. <br /> |
20 | 25 | * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br /> |
21 | 26 | * <B>Company</B> 地利集团 |
22 | - * @createTime 2015年6月10日 下午1:40:41 | |
23 | - * @author zhangshirui | |
27 | + * @createTime 2017年1月10日 下午1:40:41 | |
28 | + * @author jiangchengyong | |
24 | 29 | */ |
25 | 30 | @Service |
26 | 31 | public class ShopRPCImpl implements ShopRPC { |
27 | 32 | |
28 | 33 | private Logger logger = LoggerFactory.getLogger(ShopRPCImpl.class); |
29 | 34 | |
35 | + @Resource | |
36 | + private MyAppClient myAppClient; | |
30 | 37 | /** |
31 | 38 | * @param shopSaveInput 店铺基本信息 |
32 | 39 | * @return Integer |
33 | 40 | * @comment 创建店铺 |
34 | - * @author kelan | |
41 | + * @author jiangchengyong | |
35 | 42 | * @time 2016/11/29 19:03 |
36 | 43 | */ |
37 | 44 | @Override |
38 | 45 | public Integer createShopInfo(ShopSaveInput shopSaveInput) { |
46 | + BaseOutput<Integer> output = null; | |
47 | + try{ | |
48 | + output = myAppClient.getShopInfoService().createShopInfo(shopSaveInput); | |
49 | + if(output.getCode().equals(200)){ | |
50 | + return output.getData(); | |
51 | + } | |
52 | + }catch (Exception e){ | |
53 | + logger.info("调用创建店铺接口出错:",e); | |
54 | + throw new ServiceException(ResultCode.NETWORK_FAILED); | |
55 | + } | |
39 | 56 | return null; |
40 | 57 | } |
41 | 58 | |
... | ... | @@ -43,11 +60,21 @@ public class ShopRPCImpl implements ShopRPC { |
43 | 60 | * @param sellerId 卖家id |
44 | 61 | * @return ShopOutput |
45 | 62 | * @comment 通过卖家id获取店铺信息 |
46 | - * @author kelan | |
63 | + * @author jiangchengyong | |
47 | 64 | * @time 2016/11/29 18:54 |
48 | 65 | */ |
49 | 66 | @Override |
50 | 67 | public ShopOutput getShopBySellerId(Long sellerId) { |
68 | + BaseOutput<ShopOutput> output = null; | |
69 | + try{ | |
70 | + output = myAppClient.getShopInfoService().getShopBySellerId(sellerId); | |
71 | + if(output.getCode().equals(200)){ | |
72 | + return output.getData(); | |
73 | + } | |
74 | + }catch (Exception e){ | |
75 | + logger.info("调用通过卖家id获取店铺信息接口出错:",e); | |
76 | + throw new ServiceException(ResultCode.NETWORK_FAILED); | |
77 | + } | |
51 | 78 | return null; |
52 | 79 | } |
53 | 80 | |
... | ... | @@ -55,11 +82,21 @@ public class ShopRPCImpl implements ShopRPC { |
55 | 82 | * @param shopId 店铺id |
56 | 83 | * @return ShopOutput |
57 | 84 | * @comment 通过店铺id获取店铺信息 |
58 | - * @author kelan | |
85 | + * @author jiangchengyong | |
59 | 86 | * @time 2016/12/2 10:15 |
60 | 87 | */ |
61 | 88 | @Override |
62 | 89 | public ShopOutput getShopByShopId(Long shopId) { |
90 | + BaseOutput<ShopOutput> output = null; | |
91 | + try{ | |
92 | + output = myAppClient.getShopInfoService().getShopByShopId(shopId); | |
93 | + if(output.getCode().equals(200)){ | |
94 | + return output.getData(); | |
95 | + } | |
96 | + }catch (Exception e){ | |
97 | + logger.info("调用通过店铺id获取店铺信息接口出错:",e); | |
98 | + throw new ServiceException(ResultCode.NETWORK_FAILED); | |
99 | + } | |
63 | 100 | return null; |
64 | 101 | } |
65 | 102 | |
... | ... | @@ -67,11 +104,21 @@ public class ShopRPCImpl implements ShopRPC { |
67 | 104 | * @param shopListInput 多字段条件查询 |
68 | 105 | * @return ShopOutput |
69 | 106 | * @comment 多字段条件查询店铺信息 |
70 | - * @author kelan | |
107 | + * @author jiangchengyong | |
71 | 108 | * @time 2016/11/30 10:00 |
72 | 109 | */ |
73 | 110 | @Override |
74 | 111 | public ShopOutput getShopInfo(ShopListInput shopListInput) { |
112 | + BaseOutput<ShopOutput> output = null; | |
113 | + try{ | |
114 | + output = myAppClient.getShopInfoService().getShopInfo(shopListInput); | |
115 | + if(output.getCode().equals(200)){ | |
116 | + return output.getData(); | |
117 | + } | |
118 | + }catch (Exception e){ | |
119 | + logger.info("调用多字段条件查询店铺信息接口出错:",e); | |
120 | + throw new ServiceException(ResultCode.NETWORK_FAILED); | |
121 | + } | |
75 | 122 | return null; |
76 | 123 | } |
77 | 124 | |
... | ... | @@ -79,11 +126,21 @@ public class ShopRPCImpl implements ShopRPC { |
79 | 126 | * @param shopUpdateInput |
80 | 127 | * @return Integer |
81 | 128 | * @comment 修改店铺基本信息 |
82 | - * @author kelan | |
129 | + * @author jiangchengyong | |
83 | 130 | * @time 2016/11/30 15:43 |
84 | 131 | */ |
85 | 132 | @Override |
86 | 133 | public Boolean modifyShopBasicInfo(ShopUpdateInput shopUpdateInput) { |
134 | + BaseOutput<Boolean> output = null; | |
135 | + try{ | |
136 | + output = myAppClient.getShopInfoService().modifyShopBasicInfo(shopUpdateInput); | |
137 | + if(output.getCode().equals(200)){ | |
138 | + return output.getData(); | |
139 | + } | |
140 | + }catch (Exception e){ | |
141 | + logger.info("调用修改店铺基本信息接口出错:",e); | |
142 | + throw new ServiceException(ResultCode.NETWORK_FAILED); | |
143 | + } | |
87 | 144 | return null; |
88 | 145 | } |
89 | 146 | } | ... | ... |