Commit f594b1f853aac2718fa3a2278a0a9149cd312b64
1 parent
63e8b057
初始化工程-接口定义
Showing
34 changed files
with
768 additions
and
709 deletions
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/City.java
1 | 1 | package com.diligrp.mobsite.getway.domain.protocol; |
2 | 2 | |
3 | 3 | |
4 | +import io.swagger.annotations.ApiModelProperty; | |
4 | 5 | |
5 | 6 | /** |
6 | 7 | * <B>Description</B> 城市信息 <br /> |
... | ... | @@ -23,22 +24,27 @@ public class City { |
23 | 24 | /** |
24 | 25 | * 城市 ID |
25 | 26 | */ |
27 | + @ApiModelProperty(value = "城市id") | |
26 | 28 | private Long id; |
27 | 29 | /** |
28 | 30 | * 城市级别 |
29 | 31 | */ |
32 | + @ApiModelProperty(value = "城市级别") | |
30 | 33 | private Integer level; |
31 | 34 | /** |
32 | 35 | * 城市名称 |
33 | 36 | */ |
37 | + @ApiModelProperty(value = "城市name") | |
34 | 38 | private String name; |
35 | 39 | /** |
36 | 40 | * 是否子级分类,HASNEXT_* |
37 | 41 | */ |
42 | + @ApiModelProperty(value = "是否子级分类:1有,2否") | |
38 | 43 | private Integer hasNext; |
39 | 44 | /** |
40 | 45 | * 父级地区ID |
41 | 46 | */ |
47 | + @ApiModelProperty(value = "父级地区ID") | |
42 | 48 | private Long pid; |
43 | 49 | |
44 | 50 | /** | ... | ... |
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/common/GetAgreementUrlReq.java
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | package com.diligrp.mobsite.getway.domain.protocol.common; |
3 | 3 | |
4 | 4 | import com.diligrp.mobsite.getway.domain.protocol.BaseReq; |
5 | +import io.swagger.annotations.ApiModelProperty; | |
5 | 6 | |
6 | 7 | /** |
7 | 8 | * 店铺协议 |
... | ... | @@ -14,6 +15,7 @@ public class GetAgreementUrlReq extends BaseReq { |
14 | 15 | /** |
15 | 16 | * 协议类型 |
16 | 17 | */ |
18 | + @ApiModelProperty(value = "协议类型") | |
17 | 19 | private Integer agreementType; |
18 | 20 | |
19 | 21 | public Integer getAgreementType() { | ... | ... |
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/common/GetAgreementUrlResp.java
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | package com.diligrp.mobsite.getway.domain.protocol.common; |
3 | 3 | |
4 | 4 | import com.diligrp.mobsite.getway.domain.protocol.BaseResp; |
5 | +import io.swagger.annotations.ApiModelProperty; | |
5 | 6 | |
6 | 7 | /** |
7 | 8 | * 店铺协议 |
... | ... | @@ -14,6 +15,7 @@ public class GetAgreementUrlResp extends BaseResp { |
14 | 15 | /** |
15 | 16 | * 协议地址 |
16 | 17 | */ |
18 | + @ApiModelProperty(value = "协议地址") | |
17 | 19 | private String agreementUrl; |
18 | 20 | |
19 | 21 | public String getAgreementUrl() { | ... | ... |
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/common/GetCityReq.java
1 | 1 | package com.diligrp.mobsite.getway.domain.protocol.common; |
2 | 2 | |
3 | 3 | import com.diligrp.mobsite.getway.domain.protocol.BaseReq; |
4 | +import io.swagger.annotations.ApiModelProperty; | |
4 | 5 | |
5 | 6 | /** |
6 | 7 | * <B>Description</B> 获取地区接口 <br /> |
... | ... | @@ -30,6 +31,7 @@ public class GetCityReq extends BaseReq { |
30 | 31 | * -10:中国 |
31 | 32 | * -99999999:海外 |
32 | 33 | */ |
34 | + @ApiModelProperty(value = "城市id",required = true) | |
33 | 35 | private Long cityId; |
34 | 36 | |
35 | 37 | /** | ... | ... |
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/common/GetCitysReq.java
1 | 1 | package com.diligrp.mobsite.getway.domain.protocol.common; |
2 | 2 | |
3 | 3 | import com.diligrp.mobsite.getway.domain.protocol.BaseReq; |
4 | +import io.swagger.annotations.ApiModelProperty; | |
4 | 5 | |
5 | 6 | import java.util.List; |
6 | 7 | |
... | ... | @@ -13,6 +14,7 @@ import java.util.List; |
13 | 14 | * @author wujianjun |
14 | 15 | */ |
15 | 16 | public class GetCitysReq extends BaseReq { |
17 | + @ApiModelProperty(value = "ids") | |
16 | 18 | private List<Long> ids; |
17 | 19 | |
18 | 20 | public List<Long> getIds() { | ... | ... |
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/buyer/impl/GoodsRPCImpl.java
... | ... | @@ -86,7 +86,7 @@ public class GoodsRPCImpl implements GoodsRPC { |
86 | 86 | public List<Product> getProductByIds(List<Long> productId, String[] defindResult) { |
87 | 87 | BaseOutput<List<Product>> output = null; |
88 | 88 | try { |
89 | - output = titanClient.getProductService().getProductInfo(productId, defindResult); | |
89 | + // output = titanClient.getProductService().getProductInfo(productId, defindResult); | |
90 | 90 | } catch (Exception e) { |
91 | 91 | logger.error("titanClient接口挂掉:搜索商品详情",e); |
92 | 92 | throw new RuntimeException(ErrorMessage.NETWORK_ERROR); | ... | ... |
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/shop/ShopService.java
... | ... | @@ -15,10 +15,9 @@ import com.diligrp.mobsite.getway.domain.protocol.shop.*; |
15 | 15 | */ |
16 | 16 | public interface ShopService { |
17 | 17 | |
18 | - @Deprecated | |
18 | + | |
19 | 19 | SearchShopResp searchKeyword(SearchShopReq req); |
20 | 20 | |
21 | - GetShopByIdResp getById(GetShopByIdReq req); | |
22 | 21 | |
23 | 22 | GetShopDetailResp getDetailById(GetShopDetailReq req); |
24 | 23 | |
... | ... | @@ -107,4 +106,8 @@ public interface ShopService { |
107 | 106 | |
108 | 107 | |
109 | 108 | BindToShopResp getShopIntroduction(BindToShopReq req); |
109 | + | |
110 | + BindToShopResp bindToShop(BindToShopReq req); | |
111 | + | |
112 | + GetShopByIdResp getShopById(GetShopByIdReq req); | |
110 | 113 | } | ... | ... |
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/shop/impl/ShopServiceImpl.java
... | ... | @@ -47,10 +47,6 @@ public class ShopServiceImpl implements ShopService { |
47 | 47 | return null; |
48 | 48 | } |
49 | 49 | |
50 | - @Override | |
51 | - public GetShopByIdResp getById(GetShopByIdReq req) { | |
52 | - return null; | |
53 | - } | |
54 | 50 | |
55 | 51 | @Override |
56 | 52 | public GetShopDetailResp getDetailById(GetShopDetailReq req) { |
... | ... | @@ -116,4 +112,14 @@ public class ShopServiceImpl implements ShopService { |
116 | 112 | public BindToShopResp getShopIntroduction(BindToShopReq req) { |
117 | 113 | return null; |
118 | 114 | } |
115 | + | |
116 | + @Override | |
117 | + public BindToShopResp bindToShop(BindToShopReq req) { | |
118 | + return null; | |
119 | + } | |
120 | + | |
121 | + @Override | |
122 | + public GetShopByIdResp getShopById(GetShopByIdReq req) { | |
123 | + return null; | |
124 | + } | |
119 | 125 | } | ... | ... |
mobsite-getway-web/pom.xml
... | ... | @@ -38,8 +38,8 @@ |
38 | 38 | <version>2.2</version> |
39 | 39 | <configuration> |
40 | 40 | <port>8082</port> |
41 | - <url>http://10.28.11.173:8081/manager</url> | |
42 | - <username>getway</username> | |
41 | + <url>http://10.28.11.181:8080/manager</url> | |
42 | + <username>gateway</username> | |
43 | 43 | <password>123456</password> |
44 | 44 | <path>/</path> |
45 | 45 | </configuration> |
... | ... | @@ -79,93 +79,52 @@ |
79 | 79 | <project.view.VMDefault>layout/default</project.view.VMDefault> |
80 | 80 | |
81 | 81 | <!-- redis 配置 --> |
82 | - <project.redis.host1>10.28.10.208</project.redis.host1> | |
82 | + <project.redis.host1>10.28.11.205</project.redis.host1> | |
83 | 83 | <project.redis.port1>6379</project.redis.port1> |
84 | - | |
85 | - <!-- 商品详情链接地址 --> | |
86 | - <project.product.detail.path>http://www.1n4j.com/product/</project.product.detail.path> | |
87 | - | |
88 | - <!-- 后台默认静态资源地址 --> | |
89 | - <project.default.assets.path>http://static.1n4j.com/static/ace1.3/assets</project.default.assets.path> | |
90 | - | |
91 | - <!-- 公共样式引用 --> | |
92 | - <project.default.assets.common.path>http://static.1n4j.com/static/</project.default.assets.common.path> | |
93 | - | |
94 | - <!-- 本地资源地址 --> | |
95 | - <project.default.local.path>/</project.default.local.path> | |
96 | - | |
84 | + | |
85 | + | |
97 | 86 | <!-- 店铺域名 --> |
98 | - <project.shop.url>http://shop.1n4j.com</project.shop.url> | |
99 | - <project.shop.sign>FzZGZxd2VycXdlYXNzZHZzdnp4Y3Z</project.shop.sign> | |
100 | - <project.shop.system>pnr-getway</project.shop.system> | |
87 | + <project.shop.url>http://shopuser.zandeapp.com</project.shop.url> | |
88 | + <project.shop.sign></project.shop.sign> | |
89 | + <project.shop.system></project.shop.system> | |
101 | 90 | |
102 | 91 | <!-- sms.webchina.cn 短信发送接口的配置 --> |
103 | 92 | <project.sms.webchina.SMSKey>2cf3264488ee3beef224</project.sms.webchina.SMSKey> |
104 | 93 | <project.sms.webchina.userName>itly</project.sms.webchina.userName> |
105 | 94 | <project.sms.webchina.postURL>http://gbk.sms.webchinese.cn</project.sms.webchina.postURL> |
106 | 95 | |
107 | - <!-- interface line --> | |
108 | - <company.yibu.baseUrl>http://wl.1n4j.com</company.yibu.baseUrl> | |
109 | - <company.yibu.token>token</company.yibu.token> | |
110 | 96 | |
111 | - <!-- 七巧板 --> | |
112 | - <website.act.baseUrl>http://m.act.1n4j.com/act</website.act.baseUrl> | |
113 | - <website.act.token>token</website.act.token> | |
114 | - | |
115 | - <!-- interface user --> | |
116 | - <website.user.baseUrl>http://user.1n4j.com</website.user.baseUrl> | |
117 | - <website.user.token>token</website.user.token> | |
118 | - | |
119 | - <!-- interface websiteClient --> | |
120 | - <website.websiteClient.baseUrl>http://manweb.1n4j.com/</website.websiteClient.baseUrl> | |
121 | - <website.websiteClient.token>token</website.websiteClient.token> | |
122 | - | |
123 | - <!-- interface home --> | |
124 | - <website.home.baseUrl>http://www.1n4j.com/</website.home.baseUrl> | |
125 | - <website.home.token>token</website.home.token> | |
126 | - | |
97 | + | |
98 | + | |
127 | 99 | <!-- interface stationmsg --> |
128 | - <website.stationmsg.baseUrl>http://message.1n4j.com/api</website.stationmsg.baseUrl> | |
100 | + <website.stationmsg.baseUrl>http://message.zandeapp.com/api</website.stationmsg.baseUrl> | |
129 | 101 | <website.stationmsg.token>token</website.stationmsg.token> |
130 | 102 | |
131 | 103 | <!-- interface order --> |
132 | - <website.order.baseUrl>http://orders.1n4j.com</website.order.baseUrl> | |
104 | + <website.order.baseUrl>http://orders.zandeapp.com</website.order.baseUrl> | |
133 | 105 | <website.order.token>token</website.order.token> |
134 | 106 | |
135 | - <!-- interface srvce --> | |
136 | - <website.srvce.baseUrl>http://orders.1n4j.com/srvce-web</website.srvce.baseUrl> | |
137 | - <website.srvce.token>token</website.srvce.token> | |
107 | + | |
138 | 108 | |
139 | 109 | <!-- interface titan --> |
140 | 110 | <website.titan.accesskey>accesskey</website.titan.accesskey> |
141 | 111 | <website.titan.secretkey>secretkey</website.titan.secretkey> |
142 | - <website.titan.url>http://titan.api.1n4j.com</website.titan.url> | |
112 | + <website.titan.url>http://titan.api.zandeapp.com</website.titan.url> | |
143 | 113 | |
144 | - <!-- interface search --> | |
145 | - <website.search.host>interface.1n4j.com</website.search.host> | |
146 | - <website.search.port>9831</website.search.port> | |
147 | 114 | |
148 | - <!-- auth center interface--> | |
149 | - <website.authcenter.token>token</website.authcenter.token> | |
150 | - <website.authcenter.url>http://10.28.6.105:8080/</website.authcenter.url> | |
151 | - | |
152 | - <!--supply message interface--> | |
153 | - <website.supply.baseUrl>http://supplymsg.1n4j.com</website.supply.baseUrl> | |
154 | - <website.supply.token>token</website.supply.token> | |
155 | - | |
156 | 115 | <!--passport interface--> |
157 | - <website.passport.baseUrl>http://passport.api.1n4j.com</website.passport.baseUrl> | |
116 | + <website.passport.baseUrl>http://passport.api.zandeapp.com</website.passport.baseUrl> | |
158 | 117 | <website.passport.token>token</website.passport.token> |
159 | 118 | <!-- passportSign --> |
160 | 119 | <passport.login.passportSign>MTIzNDU2Nzg5</passport.login.passportSign> |
161 | 120 | |
162 | 121 | |
163 | 122 | <!-- messagecenter --> |
164 | - <website.messagecenter.namesrvAddr>10.28.10.209:9876</website.messagecenter.namesrvAddr> | |
123 | + <website.messagecenter.namesrvAddr>10.28.11.193:9876</website.messagecenter.namesrvAddr> | |
165 | 124 | <website.messagecenter.producerGroup>mobsite_getway</website.messagecenter.producerGroup> |
166 | 125 | |
167 | 126 | <!--cms--> |
168 | - <project.cms.baseUrl>http://cms.1n4j.com/admin</project.cms.baseUrl> | |
127 | + <project.cms.baseUrl>http://cms.zandeapp.com/admin</project.cms.baseUrl> | |
169 | 128 | <project.cms.port>80</project.cms.port> |
170 | 129 | |
171 | 130 | <!-- fastdfs--> |
... | ... | @@ -179,7 +138,7 @@ |
179 | 138 | <project.imageserver.prefix>http://10.28.6.153</project.imageserver.prefix> |
180 | 139 | |
181 | 140 | <!-- 上传文件服务 --> |
182 | - <project.store.url>http://up.1n4j.com</project.store.url> | |
141 | + <project.store.url>http://up.zandeapp.com</project.store.url> | |
183 | 142 | <project.store.imageAccessKey>jNvRQi3lLAY7tFpJkWYeF5Fa99Cl6kZRcEiMaZGp</project.store.imageAccessKey> |
184 | 143 | <project.store.imageSecretKey>1fsaziPx11A3llwHIi84BsIyF90_rB9IAqIx7pU8</project.store.imageSecretKey> |
185 | 144 | <!-- 上传音频服务 --> |
... | ... | @@ -187,13 +146,13 @@ |
187 | 146 | <project.store.messageSecretKey>00V-jKrjBgpePC2gSuUJE7cWQ1ReJuzltvXA5yq-</project.store.messageSecretKey> |
188 | 147 | <!-- 关键词过滤配置--> |
189 | 148 | <project.keyword.token></project.keyword.token> |
190 | - <project.keyword.url>http://keyword.filter.1n4j.com</project.keyword.url> | |
149 | + <project.keyword.url>http://keyword.filter.zandeapp.com</project.keyword.url> | |
191 | 150 | <!-- 网关配置--> |
192 | 151 | <getway.log.isPrintParam>true</getway.log.isPrintParam> |
193 | 152 | |
194 | 153 | <!-- 数据库连接池配置文件 --> |
195 | 154 | <project.dbpool.driverClass>org.mariadb.jdbc.Driver</project.dbpool.driverClass> |
196 | - <project.dbpool.jdbcUrl>jdbc:mysql://10.28.10.188:3306/mobsite_man?useUnicode=true&characterEncoding=utf8</project.dbpool.jdbcUrl> | |
155 | + <project.dbpool.jdbcUrl>jdbc:mysql://10.28.11.162:3306/mobsite_man?useUnicode=true&characterEncoding=utf8</project.dbpool.jdbcUrl> | |
197 | 156 | <project.dbpool.username>root</project.dbpool.username> |
198 | 157 | <project.dbpool.password>123456</project.dbpool.password> |
199 | 158 | <project.dbpool.idleConnectionTestPeriodInMinutes>1</project.dbpool.idleConnectionTestPeriodInMinutes> |
... | ... | @@ -222,13 +181,13 @@ |
222 | 181 | <project.redis.port1>6379</project.redis.port1> |
223 | 182 | |
224 | 183 | <!-- 商品详情链接地址 --> |
225 | - <project.product.detail.path>http://www.1n4j.com/product/</project.product.detail.path> | |
184 | + <project.product.detail.path>http://www.zandeapp.com/product/</project.product.detail.path> | |
226 | 185 | |
227 | 186 | <!-- 后台默认静态资源地址 --> |
228 | - <project.default.assets.path>http://static.1n4j.com/static/ace1.3/assets</project.default.assets.path> | |
187 | + <project.default.assets.path>http://static.zandeapp.com/static/ace1.3/assets</project.default.assets.path> | |
229 | 188 | |
230 | 189 | <!-- 公共样式引用 --> |
231 | - <project.default.assets.common.path>http://static.1n4j.com/static/</project.default.assets.common.path> | |
190 | + <project.default.assets.common.path>http://static.zandeapp.com/static/</project.default.assets.common.path> | |
232 | 191 | |
233 | 192 | <!-- 本地资源地址 --> |
234 | 193 | <project.default.local.path>/</project.default.local.path> |
... | ... | @@ -237,7 +196,7 @@ |
237 | 196 | <project.imageserver.prefix>http://10.28.6.153</project.imageserver.prefix> |
238 | 197 | |
239 | 198 | <!-- 店铺域名 --> |
240 | - <project.shop.url>http://shop.1n4j.com</project.shop.url> | |
199 | + <project.shop.url>http://shop.zandeapp.com</project.shop.url> | |
241 | 200 | <project.shop.sign>FzZGZxd2VycXdlYXNzZHZzdnp4Y3Z</project.shop.sign> |
242 | 201 | <project.shop.system>pnr-getway</project.shop.system> |
243 | 202 | |
... | ... | @@ -247,60 +206,60 @@ |
247 | 206 | <project.sms.webchina.postURL>http://gbk.sms.webchinese.cn</project.sms.webchina.postURL> |
248 | 207 | |
249 | 208 | <!-- interface line --> |
250 | - <company.yibu.baseUrl>http://wl.1n4j.com</company.yibu.baseUrl> | |
209 | + <company.yibu.baseUrl>http://wl.zandeapp.com</company.yibu.baseUrl> | |
251 | 210 | <company.yibu.token>token</company.yibu.token> |
252 | 211 | |
253 | 212 | <!-- 七巧板 --> |
254 | - <website.act.baseUrl>http://m.act.1n4j.com/act</website.act.baseUrl> | |
213 | + <website.act.baseUrl>http://m.act.zandeapp.com/act</website.act.baseUrl> | |
255 | 214 | <website.act.token>token</website.act.token> |
256 | 215 | |
257 | 216 | <!-- interface user --> |
258 | - <website.user.baseUrl>http://user.1n4j.com</website.user.baseUrl> | |
217 | + <website.user.baseUrl>http://user.zandeapp.com</website.user.baseUrl> | |
259 | 218 | <website.user.token>token</website.user.token> |
260 | 219 | |
261 | 220 | <!-- interface order --> |
262 | - <website.order.baseUrl>http://orders.1n4j.com</website.order.baseUrl> | |
221 | + <website.order.baseUrl>http://orders.zandeapp.com</website.order.baseUrl> | |
263 | 222 | <website.order.token>token</website.order.token> |
264 | 223 | <!-- interface srvce --> |
265 | - <website.srvce.baseUrl>http://orders.1n4j.com</website.srvce.baseUrl> | |
224 | + <website.srvce.baseUrl>http://orders.zandeapp.com</website.srvce.baseUrl> | |
266 | 225 | <website.srvce.token>token</website.srvce.token> |
267 | 226 | <!-- interface home --> |
268 | - <website.home.baseUrl>http://www.1n4j.com</website.home.baseUrl> | |
227 | + <website.home.baseUrl>http://www.zandeapp.com</website.home.baseUrl> | |
269 | 228 | <website.home.token>token</website.home.token> |
270 | 229 | <!-- interface stationmsg --> |
271 | - <website.stationmsg.baseUrl>http://message.1n4j.com/api</website.stationmsg.baseUrl> | |
230 | + <website.stationmsg.baseUrl>http://message.zandeapp.com/api</website.stationmsg.baseUrl> | |
272 | 231 | <website.stationmsg.token>token</website.stationmsg.token> |
273 | 232 | <!--supply message interface--> |
274 | - <website.supply.baseUrl>http://supplymsg.1n4j.com</website.supply.baseUrl> | |
233 | + <website.supply.baseUrl>http://supplymsg.zandeapp.com</website.supply.baseUrl> | |
275 | 234 | <website.supply.token>token</website.supply.token> |
276 | 235 | <!-- interface websiteClient --> |
277 | - <website.websiteClient.baseUrl>http://manweb.1n4j.com/</website.websiteClient.baseUrl> | |
236 | + <website.websiteClient.baseUrl>http://manweb.zandeapp.com/</website.websiteClient.baseUrl> | |
278 | 237 | <website.websiteClient.token>token</website.websiteClient.token> |
279 | 238 | |
280 | 239 | <!-- interface order --> |
281 | - <website.order.baseUrl>http://orders.1n4j.com</website.order.baseUrl> | |
240 | + <website.order.baseUrl>http://orders.zandeapp.com</website.order.baseUrl> | |
282 | 241 | <website.order.token>token</website.order.token> |
283 | 242 | |
284 | 243 | <!-- interface srvce --> |
285 | - <website.srvce.baseUrl>http://orders.1n4j.com/srvce-web</website.srvce.baseUrl> | |
244 | + <website.srvce.baseUrl>http://orders.zandeapp.com/srvce-web</website.srvce.baseUrl> | |
286 | 245 | <website.srvce.token>token</website.srvce.token> |
287 | 246 | |
288 | 247 | |
289 | 248 | <!-- interface titan --> |
290 | 249 | <website.titan.accesskey>accesskey</website.titan.accesskey> |
291 | 250 | <website.titan.secretkey>secretkey</website.titan.secretkey> |
292 | - <website.titan.url>http://titan.api.1n4j.com</website.titan.url> | |
251 | + <website.titan.url>http://titan.api.zandeapp.com</website.titan.url> | |
293 | 252 | |
294 | 253 | <!-- interface search --> |
295 | - <website.search.host>interface.1n4j.com</website.search.host> | |
254 | + <website.search.host>interface.zandeapp.com</website.search.host> | |
296 | 255 | <website.search.port>9831</website.search.port> |
297 | 256 | |
298 | 257 | <!-- auth center --> |
299 | 258 | <website.authcenter.token>token</website.authcenter.token> |
300 | - <website.authcenter.url>http://authencenter.1n4j.com</website.authcenter.url> | |
259 | + <website.authcenter.url>http://authencenter.zandeapp.com</website.authcenter.url> | |
301 | 260 | |
302 | 261 | <!--passport interface--> |
303 | - <website.passport.baseUrl>http://passport.api.1n4j.com</website.passport.baseUrl> | |
262 | + <website.passport.baseUrl>http://passport.api.zandeapp.com</website.passport.baseUrl> | |
304 | 263 | <website.passport.token>token</website.passport.token> |
305 | 264 | |
306 | 265 | <!-- passportSign --> |
... | ... | @@ -311,7 +270,7 @@ |
311 | 270 | <website.messagecenter.producerGroup>mobsite_getway</website.messagecenter.producerGroup> |
312 | 271 | |
313 | 272 | <!--cms--> |
314 | - <project.cms.baseUrl>http://cms.1n4j.com/admin</project.cms.baseUrl> | |
273 | + <project.cms.baseUrl>http://cms.zandeapp.com/admin</project.cms.baseUrl> | |
315 | 274 | <project.cms.port>80</project.cms.port> |
316 | 275 | |
317 | 276 | <!-- fastdfs --> |
... | ... | @@ -324,7 +283,7 @@ |
324 | 283 | |
325 | 284 | |
326 | 285 | <!-- 上传文件服务 --> |
327 | - <project.store.url>http://up.1n4j.com</project.store.url> | |
286 | + <project.store.url>http://up.zandeapp.com</project.store.url> | |
328 | 287 | <project.store.imageAccessKey>jNvRQi3lLAY7tFpJkWYeF5Fa99Cl6kZRcEiMaZGp</project.store.imageAccessKey> |
329 | 288 | <project.store.imageSecretKey>1fsaziPx11A3llwHIi84BsIyF90_rB9IAqIx7pU8</project.store.imageSecretKey> |
330 | 289 | <!-- 上传音频服务 --> |
... | ... | @@ -341,7 +300,7 @@ |
341 | 300 | |
342 | 301 | <!-- 关键词过滤配置--> |
343 | 302 | <project.keyword.token></project.keyword.token> |
344 | - <project.keyword.url>http://keyword.filter.1n4j.com</project.keyword.url> | |
303 | + <project.keyword.url>http://keyword.filter.zandeapp.com</project.keyword.url> | |
345 | 304 | <!-- 网关配置--> |
346 | 305 | <getway.log.isPrintParam>true</getway.log.isPrintParam> |
347 | 306 | |
... | ... | @@ -371,26 +330,26 @@ |
371 | 330 | <project.view.VMDefault>layout/default</project.view.VMDefault> |
372 | 331 | |
373 | 332 | <!-- redis 配置 --> |
374 | - <project.redis.host1>redis.1n4j.com</project.redis.host1> | |
333 | + <project.redis.host1>redis.zandeapp.com</project.redis.host1> | |
375 | 334 | <project.redis.port1>6379</project.redis.port1> |
376 | 335 | |
377 | 336 | <!-- 商品详情链接地址 --> |
378 | - <project.product.detail.path>http://www.1n4j.com/product/</project.product.detail.path> | |
337 | + <project.product.detail.path>http://www.zandeapp.com/product/</project.product.detail.path> | |
379 | 338 | |
380 | 339 | <!-- 后台默认静态资源地址 --> |
381 | - <project.default.assets.path>http://static.1n4j.com/static/ace1.3/assets</project.default.assets.path> | |
340 | + <project.default.assets.path>http://static.zandeapp.com/static/ace1.3/assets</project.default.assets.path> | |
382 | 341 | |
383 | 342 | <!-- 公共样式引用 --> |
384 | - <project.default.assets.common.path>http://static.1n4j.com/static/</project.default.assets.common.path> | |
343 | + <project.default.assets.common.path>http://static.zandeapp.com/static/</project.default.assets.common.path> | |
385 | 344 | |
386 | 345 | <!-- 本地资源地址 --> |
387 | 346 | <project.default.local.path>/</project.default.local.path> |
388 | 347 | |
389 | 348 | <project.imageserver.prefix>http://192.168.28.22:8000</project.imageserver.prefix> |
390 | - <project.imageserver.domain>1n4j.com</project.imageserver.domain> | |
349 | + <project.imageserver.domain>zandeapp.com</project.imageserver.domain> | |
391 | 350 | |
392 | 351 | <!-- 店铺域名 --> |
393 | - <project.shop.url>http://shop.1n4j.com</project.shop.url> | |
352 | + <project.shop.url>http://shop.zandeapp.com</project.shop.url> | |
394 | 353 | <project.shop.sign>FzZGZxd2VycXdlYXNzZHZzdnp4Y3Z</project.shop.sign> |
395 | 354 | <project.shop.system>pnr-getway</project.shop.system> |
396 | 355 | |
... | ... | @@ -400,60 +359,60 @@ |
400 | 359 | <project.sms.webchina.postURL>http://gbk.sms.webchinese.cn</project.sms.webchina.postURL> |
401 | 360 | |
402 | 361 | <!-- interface line --> |
403 | - <company.yibu.baseUrl>http://wl.1n4j.com</company.yibu.baseUrl> | |
362 | + <company.yibu.baseUrl>http://wl.zandeapp.com</company.yibu.baseUrl> | |
404 | 363 | <company.yibu.token>token</company.yibu.token> |
405 | 364 | |
406 | 365 | <!-- 七巧板 --> |
407 | - <website.act.baseUrl>http://m.act.1n4j.com/act</website.act.baseUrl> | |
366 | + <website.act.baseUrl>http://m.act.zandeapp.com/act</website.act.baseUrl> | |
408 | 367 | <website.act.token>token</website.act.token> |
409 | 368 | |
410 | 369 | <!-- interface user --> |
411 | - <website.user.baseUrl>http://user.1n4j.com</website.user.baseUrl> | |
370 | + <website.user.baseUrl>http://user.zandeapp.com</website.user.baseUrl> | |
412 | 371 | <website.user.token>token</website.user.token> |
413 | 372 | |
414 | 373 | <!-- interface order --> |
415 | - <website.order.baseUrl>http://orders.1n4j.com</website.order.baseUrl> | |
374 | + <website.order.baseUrl>http://orders.zandeapp.com</website.order.baseUrl> | |
416 | 375 | <website.order.token>token</website.order.token> |
417 | 376 | <!-- interface srvce --> |
418 | - <website.srvce.baseUrl>http://orders.1n4j.com</website.srvce.baseUrl> | |
377 | + <website.srvce.baseUrl>http://orders.zandeapp.com</website.srvce.baseUrl> | |
419 | 378 | <website.srvce.token>token</website.srvce.token> |
420 | 379 | <!-- interface home --> |
421 | - <website.home.baseUrl>http://www.1n4j.com</website.home.baseUrl> | |
380 | + <website.home.baseUrl>http://www.zandeapp.com</website.home.baseUrl> | |
422 | 381 | <website.home.token>token</website.home.token> |
423 | 382 | <!-- interface stationmsg --> |
424 | - <website.stationmsg.baseUrl>http://message.1n4j.com/api</website.stationmsg.baseUrl> | |
383 | + <website.stationmsg.baseUrl>http://message.zandeapp.com/api</website.stationmsg.baseUrl> | |
425 | 384 | <website.stationmsg.token>token</website.stationmsg.token> |
426 | 385 | <!--supply message interface--> |
427 | - <website.supply.baseUrl>http://supplymsg.1n4j.com</website.supply.baseUrl> | |
386 | + <website.supply.baseUrl>http://supplymsg.zandeapp.com</website.supply.baseUrl> | |
428 | 387 | <website.supply.token>token</website.supply.token> |
429 | 388 | <!-- interface websiteClient --> |
430 | - <website.websiteClient.baseUrl>http://manweb.1n4j.com/</website.websiteClient.baseUrl> | |
389 | + <website.websiteClient.baseUrl>http://manweb.zandeapp.com/</website.websiteClient.baseUrl> | |
431 | 390 | <website.websiteClient.token>token</website.websiteClient.token> |
432 | 391 | |
433 | 392 | <!-- interface order --> |
434 | - <website.order.baseUrl>http://orders.1n4j.com</website.order.baseUrl> | |
393 | + <website.order.baseUrl>http://orders.zandeapp.com</website.order.baseUrl> | |
435 | 394 | <website.order.token>token</website.order.token> |
436 | 395 | |
437 | 396 | <!-- interface srvce --> |
438 | - <website.srvce.baseUrl>http://orders.1n4j.com/srvce-web</website.srvce.baseUrl> | |
397 | + <website.srvce.baseUrl>http://orders.zandeapp.com/srvce-web</website.srvce.baseUrl> | |
439 | 398 | <website.srvce.token>token</website.srvce.token> |
440 | 399 | |
441 | 400 | |
442 | 401 | <!-- interface titan --> |
443 | 402 | <website.titan.accesskey>accesskey</website.titan.accesskey> |
444 | 403 | <website.titan.secretkey>secretkey</website.titan.secretkey> |
445 | - <website.titan.url>http://titan.api.1n4j.com</website.titan.url> | |
404 | + <website.titan.url>http://titan.api.zandeapp.com</website.titan.url> | |
446 | 405 | |
447 | 406 | <!-- interface search --> |
448 | - <website.search.host>interface.1n4j.com</website.search.host> | |
407 | + <website.search.host>interface.zandeapp.com</website.search.host> | |
449 | 408 | <website.search.port>9831</website.search.port> |
450 | 409 | |
451 | 410 | <!-- auth center --> |
452 | 411 | <website.authcenter.token>token</website.authcenter.token> |
453 | - <website.authcenter.url>http://authencenter.1n4j.com</website.authcenter.url> | |
412 | + <website.authcenter.url>http://authencenter.zandeapp.com</website.authcenter.url> | |
454 | 413 | |
455 | 414 | <!--passport interface--> |
456 | - <website.passport.baseUrl>http://passport.api.1n4j.com</website.passport.baseUrl> | |
415 | + <website.passport.baseUrl>http://passport.api.zandeapp.com</website.passport.baseUrl> | |
457 | 416 | <website.passport.token>token</website.passport.token> |
458 | 417 | |
459 | 418 | <!-- passportSign --> |
... | ... | @@ -464,7 +423,7 @@ |
464 | 423 | <website.messagecenter.producerGroup>mobsite_getway</website.messagecenter.producerGroup> |
465 | 424 | |
466 | 425 | <!--cms--> |
467 | - <project.cms.baseUrl>http://cms.1n4j.com/admin</project.cms.baseUrl> | |
426 | + <project.cms.baseUrl>http://cms.zandeapp.com/admin</project.cms.baseUrl> | |
468 | 427 | <project.cms.port>80</project.cms.port> |
469 | 428 | |
470 | 429 | <!-- fastdfs --> |
... | ... | @@ -478,7 +437,7 @@ |
478 | 437 | |
479 | 438 | |
480 | 439 | <!-- 上传文件服务 --> |
481 | - <project.store.url>http://up.1n4j.com</project.store.url> | |
440 | + <project.store.url>http://up.zandeapp.com</project.store.url> | |
482 | 441 | <project.store.imageAccessKey>d6a300418bd6fa2178b3bbb06a421f32</project.store.imageAccessKey> |
483 | 442 | <project.store.imageSecretKey>8d2d1ac5541dcfbbd78ac1793ce4f782</project.store.imageSecretKey> |
484 | 443 | <!-- 上传音频服务 --> |
... | ... | @@ -495,13 +454,13 @@ |
495 | 454 | |
496 | 455 | <!-- 关键词过滤配置--> |
497 | 456 | <project.keyword.token></project.keyword.token> |
498 | - <project.keyword.url>http://keyword.filter.1n4j.com</project.keyword.url> | |
457 | + <project.keyword.url>http://keyword.filter.zandeapp.com</project.keyword.url> | |
499 | 458 | <!-- 网关配置--> |
500 | 459 | <getway.log.isPrintParam>true</getway.log.isPrintParam> |
501 | 460 | |
502 | 461 | <!-- 数据库连接池配置文件 --> |
503 | 462 | <project.dbpool.driverClass>org.mariadb.jdbc.Driver</project.dbpool.driverClass> |
504 | - <project.dbpool.jdbcUrl>jdbc:mysql://mobsite.man.db.1n4j.com:3306/agriez_mobsite_man?useUnicode=true&characterEncoding=utf8</project.dbpool.jdbcUrl> | |
463 | + <project.dbpool.jdbcUrl>jdbc:mysql://mobsite.man.db.zandeapp.com:3306/agriez_mobsite_man?useUnicode=true&characterEncoding=utf8</project.dbpool.jdbcUrl> | |
505 | 464 | <project.dbpool.username>root</project.dbpool.username> |
506 | 465 | <project.dbpool.password>123456</project.dbpool.password> |
507 | 466 | <project.dbpool.idleConnectionTestPeriodInMinutes>1</project.dbpool.idleConnectionTestPeriodInMinutes> |
... | ... | @@ -522,28 +481,28 @@ |
522 | 481 | <project.view.VMDefault>layout/default</project.view.VMDefault> |
523 | 482 | |
524 | 483 | <!-- redis 配置 --> |
525 | - <project.redis.host1>udlredis.1n4j.com</project.redis.host1> | |
484 | + <project.redis.host1>udlredis.zandeapp.com</project.redis.host1> | |
526 | 485 | <project.redis.port1>6379</project.redis.port1> |
527 | 486 | |
528 | 487 | <!-- 商品详情链接地址 --> |
529 | - <project.product.detail.path>http://www.1n4j.com/product/</project.product.detail.path> | |
488 | + <project.product.detail.path>http://www.zandeapp.com/product/</project.product.detail.path> | |
530 | 489 | |
531 | 490 | <!-- 后台默认静态资源地址 --> |
532 | - <project.default.assets.path>http://static.1n4j.com/static/ace1.3/assets</project.default.assets.path> | |
491 | + <project.default.assets.path>http://static.zandeapp.com/static/ace1.3/assets</project.default.assets.path> | |
533 | 492 | |
534 | 493 | <!-- 公共样式引用 --> |
535 | - <project.default.assets.common.path>http://static.1n4j.com/static/</project.default.assets.common.path> | |
494 | + <project.default.assets.common.path>http://static.zandeapp.com/static/</project.default.assets.common.path> | |
536 | 495 | |
537 | 496 | <!-- 本地资源地址 --> |
538 | 497 | <project.default.local.path>/</project.default.local.path> |
539 | 498 | |
540 | 499 | <!-- 图片服务器前缀 --> |
541 | 500 | <project.imageserver.prefix>http://192.168.28.22:8000</project.imageserver.prefix> |
542 | - <project.imageserver.domain>1n4j.com</project.imageserver.domain> | |
501 | + <project.imageserver.domain>zandeapp.com</project.imageserver.domain> | |
543 | 502 | |
544 | 503 | |
545 | 504 | <!-- 店铺域名 --> |
546 | - <project.shop.url>http://shop.1n4j.com</project.shop.url> | |
505 | + <project.shop.url>http://shop.zandeapp.com</project.shop.url> | |
547 | 506 | <project.shop.sign>FzZGZxd2VycXdlYXNzZHZzdnp4Y3Z</project.shop.sign> |
548 | 507 | <project.shop.system>pnr-getway</project.shop.system> |
549 | 508 | |
... | ... | @@ -555,67 +514,67 @@ |
555 | 514 | |
556 | 515 | |
557 | 516 | <!-- interface user --> |
558 | - <website.user.baseUrl>http://user.1n4j.com</website.user.baseUrl> | |
517 | + <website.user.baseUrl>http://user.zandeapp.com</website.user.baseUrl> | |
559 | 518 | <website.user.token>token</website.user.token> |
560 | 519 | |
561 | 520 | <!-- interface order --> |
562 | - <website.order.baseUrl>http://orders.1n4j.com</website.order.baseUrl> | |
521 | + <website.order.baseUrl>http://orders.zandeapp.com</website.order.baseUrl> | |
563 | 522 | <website.order.token>token</website.order.token> |
564 | 523 | |
565 | 524 | <!-- interface srvce --> |
566 | - <website.srvce.baseUrl>http://orders.1n4j.com</website.srvce.baseUrl> | |
525 | + <website.srvce.baseUrl>http://orders.zandeapp.com</website.srvce.baseUrl> | |
567 | 526 | <website.srvce.token>token</website.srvce.token> |
568 | 527 | |
569 | 528 | <!-- interface home --> |
570 | - <website.home.baseUrl>http://www.1n4j.com</website.home.baseUrl> | |
529 | + <website.home.baseUrl>http://www.zandeapp.com</website.home.baseUrl> | |
571 | 530 | <website.home.token>token</website.home.token> |
572 | 531 | |
573 | 532 | <!-- interface stationmsg --> |
574 | - <website.stationmsg.baseUrl>http://message.1n4j.com/api</website.stationmsg.baseUrl> | |
533 | + <website.stationmsg.baseUrl>http://message.zandeapp.com/api</website.stationmsg.baseUrl> | |
575 | 534 | <website.stationmsg.token>token</website.stationmsg.token> |
576 | 535 | |
577 | 536 | <!--supply message interface--> |
578 | - <website.supply.baseUrl>http://supplymsg.1n4j.com</website.supply.baseUrl> | |
537 | + <website.supply.baseUrl>http://supplymsg.zandeapp.com</website.supply.baseUrl> | |
579 | 538 | <website.supply.token>token</website.supply.token> |
580 | 539 | |
581 | 540 | <!-- interface websiteClient --> |
582 | - <website.websiteClient.baseUrl>http://manweb.1n4j.com/</website.websiteClient.baseUrl> | |
541 | + <website.websiteClient.baseUrl>http://manweb.zandeapp.com/</website.websiteClient.baseUrl> | |
583 | 542 | <website.websiteClient.token>token</website.websiteClient.token> |
584 | 543 | |
585 | 544 | <!-- interface order --> |
586 | - <website.order.baseUrl>http://orders.1n4j.com</website.order.baseUrl> | |
545 | + <website.order.baseUrl>http://orders.zandeapp.com</website.order.baseUrl> | |
587 | 546 | <website.order.token>token</website.order.token> |
588 | 547 | |
589 | 548 | <!-- interface srvce --> |
590 | - <website.srvce.baseUrl>http://orders.1n4j.com/srvce-web</website.srvce.baseUrl> | |
549 | + <website.srvce.baseUrl>http://orders.zandeapp.com/srvce-web</website.srvce.baseUrl> | |
591 | 550 | <website.srvce.token>token</website.srvce.token> |
592 | 551 | |
593 | 552 | |
594 | 553 | <!-- interface titan --> |
595 | 554 | <website.titan.accesskey>accesskey</website.titan.accesskey> |
596 | 555 | <website.titan.secretkey>secretkey</website.titan.secretkey> |
597 | - <website.titan.url>http://titan.api.1n4j.com</website.titan.url> | |
556 | + <website.titan.url>http://titan.api.zandeapp.com</website.titan.url> | |
598 | 557 | |
599 | 558 | <!-- interface search --> |
600 | - <website.search.host>interface.dd.1n4j.com</website.search.host> | |
559 | + <website.search.host>interface.dd.zandeapp.com</website.search.host> | |
601 | 560 | <website.search.port>9831</website.search.port> |
602 | 561 | |
603 | 562 | <!-- auth center --> |
604 | 563 | <website.authcenter.token>token</website.authcenter.token> |
605 | - <website.authcenter.url>http://authencenter.1n4j.com/</website.authcenter.url> | |
564 | + <website.authcenter.url>http://authencenter.zandeapp.com/</website.authcenter.url> | |
606 | 565 | |
607 | 566 | <!-- messagecenter --> |
608 | 567 | <website.messagecenter.namesrvAddr>192.168.28.34:9876;192.168.28.35:9876</website.messagecenter.namesrvAddr> |
609 | 568 | <website.messagecenter.producerGroup>mobsite_getway</website.messagecenter.producerGroup> |
610 | 569 | |
611 | 570 | <!--passport interface--> |
612 | - <website.passport.baseUrl>http://passport.api.1n4j.com</website.passport.baseUrl> | |
571 | + <website.passport.baseUrl>http://passport.api.zandeapp.com</website.passport.baseUrl> | |
613 | 572 | <website.passport.token>token</website.passport.token> |
614 | 573 | <!-- passportSign --> |
615 | 574 | <passport.login.passportSign>TkdqQUhyUFprVGdJM2U3UzZvUWdrQjZwYnpibmRK</passport.login.passportSign> |
616 | 575 | |
617 | 576 | <!--cms--> |
618 | - <project.cms.baseUrl>http://cms.1n4j.com</project.cms.baseUrl> | |
577 | + <project.cms.baseUrl>http://cms.zandeapp.com</project.cms.baseUrl> | |
619 | 578 | <project.cms.port>80</project.cms.port> |
620 | 579 | |
621 | 580 | |
... | ... | @@ -646,13 +605,13 @@ |
646 | 605 | |
647 | 606 | <!-- 关键词过滤配置--> |
648 | 607 | <project.keyword.token></project.keyword.token> |
649 | - <project.keyword.url>http://keyword.filter.1n4j.com</project.keyword.url> | |
608 | + <project.keyword.url>http://keyword.filter.zandeapp.com</project.keyword.url> | |
650 | 609 | <!-- 网关配置--> |
651 | 610 | <getway.log.isPrintParam>false</getway.log.isPrintParam> |
652 | 611 | |
653 | 612 | <!-- 数据库连接池配置文件 --> |
654 | 613 | <project.dbpool.driverClass>org.mariadb.jdbc.Driver</project.dbpool.driverClass> |
655 | - <project.dbpool.jdbcUrl>jdbc:mysql://mobsite.man.db.1n4j.com:3306/mobsite_man?useUnicode=true&characterEncoding=utf8</project.dbpool.jdbcUrl> | |
614 | + <project.dbpool.jdbcUrl>jdbc:mysql://mobsite.man.db.zandeapp.com:3306/mobsite_man?useUnicode=true&characterEncoding=utf8</project.dbpool.jdbcUrl> | |
656 | 615 | <project.dbpool.username>FG_yunwei</project.dbpool.username> |
657 | 616 | <project.dbpool.password>vtA]7xU2h~ne_b</project.dbpool.password> |
658 | 617 | <project.dbpool.idleConnectionTestPeriodInMinutes>1</project.dbpool.idleConnectionTestPeriodInMinutes> | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/base/CommonController.java
1 | -//package com.diligrp.mobsite.getway.web.api.base; | |
2 | -// | |
3 | -//import com.diligrp.mobsite.getway.domain.GetDicsReq; | |
4 | -//import com.diligrp.mobsite.getway.domain.GetDicsResp; | |
5 | -//import com.diligrp.mobsite.getway.domain.common.ErrorMessage; | |
6 | -//import com.diligrp.mobsite.getway.domain.except.ServiceException; | |
7 | -//import com.diligrp.mobsite.getway.domain.protocol.common.*; | |
8 | -//import com.diligrp.mobsite.getway.rpc.buyer.impl.StoreRPCImpl; | |
9 | -//import com.diligrp.mobsite.getway.service.common.CommonService; | |
10 | -//import com.diligrp.website.util.security.Validator; | |
11 | -//import org.slf4j.Logger; | |
12 | -//import org.slf4j.LoggerFactory; | |
13 | -//import org.springframework.stereotype.Controller; | |
14 | -//import org.springframework.web.bind.annotation.RequestBody; | |
15 | -//import org.springframework.web.bind.annotation.RequestMapping; | |
16 | -//import org.springframework.web.bind.annotation.RequestParam; | |
17 | -//import org.springframework.web.bind.annotation.ResponseBody; | |
18 | -//import org.springframework.web.multipart.MultipartFile; | |
19 | -// | |
20 | -//import javax.annotation.Resource; | |
21 | -//import javax.servlet.http.HttpServletRequest; | |
22 | -//import java.io.IOException; | |
23 | -//import java.util.ArrayList; | |
24 | -//import java.util.List; | |
25 | -// | |
26 | -///** | |
27 | -// * <B>Description</B> 公共Controller <br /> | |
28 | -// * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br /> | |
29 | -// * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br /> | |
30 | -// * <B>Company</B> 地利集团 | |
31 | -// * @createTime Aug 5, 2014 5:34:08 PM | |
32 | -// * @author zhangshirui | |
33 | -// */ | |
34 | -//@Controller | |
35 | -//@RequestMapping("/mobsiteApp/common") | |
36 | -//public class CommonController extends BaseApiController { | |
37 | -// | |
38 | -// | |
39 | -// @Resource | |
40 | -// private CommonService commonService; | |
41 | -// | |
42 | -// private Logger log = LoggerFactory.getLogger(getClass()); | |
43 | -// | |
44 | -// | |
45 | -// /** | |
46 | -// * 根据城市id查询城市信息 | |
47 | -// */ | |
48 | -// @RequestMapping("getCity") | |
49 | -// @ResponseBody | |
50 | -// public void getCity() { | |
51 | -// GetCityReq req = getRequest(GetCityReq.class); | |
52 | -// try { | |
53 | -// GetCityResp resp = commonService.getCity(Validator.isNull(req) ? 0 : req.getCityId()); | |
54 | -// sendSuccessResp(resp); | |
55 | -// } catch (Exception e) { | |
56 | -// log.error(String.format("获取国内城市接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
57 | -// sendError(e.getMessage()); | |
58 | -// } | |
59 | -// } | |
60 | -// | |
61 | -// /** | |
62 | -// * 根据城市id查询城市信息 | |
63 | -// */ | |
64 | -// @RequestMapping("getCitys") | |
65 | -// @ResponseBody | |
66 | -// public void getCitys() { | |
67 | -// GetCitysReq req = getRequest(GetCitysReq.class); | |
68 | -// try { | |
69 | -// GetCitysResp resp = commonService.getCitys(req); | |
70 | -// sendSuccessResp(resp); | |
71 | -// } catch (Exception e) { | |
72 | -// log.error(String.format("获取城市接口[msg=%s]",e.getMessage()), e); | |
73 | -// sendError(e.getMessage()); | |
74 | -// } | |
75 | -// } | |
76 | -// | |
77 | -// /** | |
78 | -// * 获取国家的城市信息,目前只支持国内城市与国家名 | |
79 | -// * 0:是所有 | |
80 | -// * -10:中国 | |
81 | -// * -9999:海外 | |
82 | -// */ | |
83 | -// @RequestMapping("getCountry") | |
84 | -// @ResponseBody | |
85 | -// public void getCountry() { | |
86 | -// GetCityReq req = getRequest(GetCityReq.class); | |
87 | -// try { | |
88 | -// GetCityResp resp = commonService.getCountry(Validator.isNull(req) || Validator.isNull(req.getCityId()) | |
89 | -// ? 0 : req.getCityId()); | |
90 | -// sendSuccessResp(resp); | |
91 | -// } catch (Exception e) { | |
92 | -// log.error(String.format("获取国家和城市接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
93 | -// sendError(e.getMessage()); | |
94 | -// } | |
95 | -// } | |
96 | -// | |
97 | -// | |
98 | -// /** | |
99 | -// * 获取国家的所有城市信息,目前只支持国内城市与国家名 | |
100 | -// */ | |
101 | -// @RequestMapping("getAllCountryTree") | |
102 | -// @ResponseBody | |
103 | -// public void getAllCountryTree() { | |
104 | -// GetCityReq req = getRequest(GetCityReq.class); | |
105 | -// try { | |
106 | -// GetAllCountryTreeResp resp = commonService.getAllCountryTree(); | |
107 | -// sendSuccessResp(resp); | |
108 | -// } catch (Exception e) { | |
109 | -// log.error(String.format("获取国家和城市接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
110 | -// sendError(e.getMessage()); | |
111 | -// } | |
112 | -// } | |
113 | -// | |
114 | -// | |
115 | -// /** | |
116 | -// * 获取单位信息 | |
117 | -// * | |
118 | -// * getUnitInfo | |
119 | -// * | |
120 | -// * GetUnitInfoReq | |
121 | -// * GetUnitInfoResp | |
122 | -// */ | |
123 | -// @RequestMapping("getUnitInfo") | |
124 | -// @ResponseBody | |
125 | -// public void getUnitInfo() { | |
126 | -// GetUnitInfoReq req = getRequest(GetUnitInfoReq.class); | |
127 | -// try { | |
128 | -// GetUnitInfoResp resp = commonService.getUnitInfo(req); | |
129 | -// sendSuccessResp(resp); | |
130 | -// } catch (Exception e) { | |
131 | -// log.error(String.format("获取单位信息接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
132 | -// sendError(e.getMessage()); | |
133 | -// } | |
134 | -// } | |
135 | -// | |
136 | -// /** | |
137 | -// * 上传图片 | |
138 | -// * | |
139 | -// * uploadImg | |
140 | -// */ | |
141 | -// @RequestMapping("uploadImg") | |
142 | -// @ResponseBody | |
143 | -// public void uploadImg(@RequestBody byte[] file){ | |
144 | -// sendJSON(uploadFile(file,StoreRPCImpl.BUDGET_NAME_IMAGES,StoreRPCImpl.FILE_TYPE_IMGE)); | |
145 | -// } | |
146 | -// | |
147 | -// /** | |
148 | -// * 上传图片,获取全部url | |
149 | -// * | |
150 | -// * uploadImgFullUrl | |
151 | -// */ | |
152 | -// @RequestMapping("uploadImgFullUrl") | |
153 | -// @ResponseBody | |
154 | -// public void uploadImgFullUrl(@RequestParam("files") MultipartFile[] files){ | |
155 | -// | |
156 | -// try { | |
157 | -// List<UploadFileResp> listResp = new ArrayList<>(); | |
158 | -// for (MultipartFile file : files) { | |
159 | -// UploadFileResp resp = uploadFile(file.getBytes(),StoreRPCImpl.BUDGET_NAME_IMAGES,StoreRPCImpl.FILE_TYPE_IMGE); | |
160 | -// listResp.add(resp); | |
161 | -// } | |
162 | -// sendJSON(listResp); | |
163 | -// } catch (IOException e) { | |
164 | -// log.error(String.format("上传图片接口[msg=%s]",e.getMessage()), e); | |
165 | -// sendError(e.getMessage()); | |
166 | -// } | |
167 | -// } | |
168 | -// | |
169 | -// /** | |
170 | -// * 上传音频 | |
171 | -// * | |
172 | -// */ | |
173 | -// @RequestMapping("uploadAudio") | |
174 | -// @ResponseBody | |
175 | -// public void uploadAudio(@RequestBody byte[] file){ | |
176 | -// sendJSON(uploadFile(file, StoreRPCImpl.BUDGET_NAME_MESSAGE,StoreRPCImpl.FILE_TYPE_AUDIO)); | |
177 | -// } | |
178 | -// | |
179 | -// private UploadFileResp uploadFile(@RequestBody byte[] file,String bucket,String fileType) { | |
180 | -// try { | |
181 | -// return commonService.uploadFiles(file, bucket,fileType); | |
182 | -// }catch(ServiceException e){ | |
183 | -// log.error(String.format("Code=%s,ErrorMessage=%s", | |
184 | -// e.getCode(), e.getMessage()), e); | |
185 | -// super.sendError(e.getCode(), e.getMessage()); | |
186 | -// } catch (Exception e) { | |
187 | -// log.error(String.format("上传文件错误[msg=%s]",e.getMessage()), e); | |
188 | -// sendError(e.getMessage()); | |
189 | -// } | |
190 | -// return null; | |
191 | -// } | |
192 | -// | |
193 | -// /** | |
194 | -// * 获取字典信息 | |
195 | -// */ | |
196 | -// @RequestMapping("getSystemConfig") | |
197 | -// @ResponseBody | |
198 | -// public void getSystemConfig(){ | |
199 | -// GetSystemConfigReq req = getRequest(GetSystemConfigReq.class); | |
200 | -// if (Validator.isNull(req.getCode())) { | |
201 | -// sendError(ErrorMessage.COMMON_REQUEST_PARAM_ERROR); | |
202 | -// } | |
203 | -// try { | |
204 | -// GetSystemConfigResp resp = commonService.getDicInfoByCode(req.getCode()); | |
205 | -// sendSuccessResp(resp); | |
206 | -// } catch (Exception e) { | |
207 | -// log.error(String.format("获取国家和城市接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
208 | -// sendError(e.getMessage()); | |
209 | -// } | |
210 | -// } | |
211 | -// | |
212 | -// /** | |
213 | -// * 获取首页统计信息 | |
214 | -// */ | |
215 | -// @RequestMapping("getHomeStatistics") | |
216 | -// @ResponseBody | |
217 | -// public void getHomeStatistics(){ | |
218 | -// GetHomeStatisticsReq req = getRequest(GetHomeStatisticsReq.class); | |
219 | -// try { | |
220 | -// GetHomeStatisticsResp resp = commonService.getHomeStatistics(req); | |
221 | -// sendSuccessResp(resp); | |
222 | -// } catch (Exception e) { | |
223 | -// log.error(String.format("获取国家和城市接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
224 | -// sendError(e.getMessage()); | |
225 | -// } | |
226 | -// } | |
227 | -// | |
228 | -// /** | |
229 | -// * 根据数据字典code获取全部的数据字典 | |
230 | -// */ | |
231 | -// @RequestMapping("getDics") | |
232 | -// @ResponseBody | |
233 | -// public void getDics(){ | |
234 | -// GetDicsReq req = getRequest(GetDicsReq.class); | |
235 | -// try { | |
236 | -// GetDicsResp resp = commonService.getDics(req); | |
237 | -// sendSuccessResp(resp); | |
238 | -// } catch (Exception e) { | |
239 | -// log.error(String.format("获取数据字典接口[msg=%s,UserId=%s]",e.getMessage(),req.getCode()), e); | |
240 | -// sendError(e.getMessage()); | |
241 | -// } | |
242 | -// } | |
243 | -// | |
244 | -// /** | |
245 | -// * 获取协议地址协议 | |
246 | -// * @createTime 2015年6月9日 下午3:52:12 | |
247 | -// * @author zhangshirui | |
248 | -// */ | |
249 | -// @RequestMapping("getAgreementUrl") | |
250 | -// @ResponseBody | |
251 | -// public void getAgreementUrl() { | |
252 | -// GetAgreementUrlReq req = getRequest(GetAgreementUrlReq.class); | |
253 | -// try { | |
254 | -// GetAgreementUrlResp resp = commonService.getAgreementUrl(req); | |
255 | -// sendSuccessResp(resp); | |
256 | -// } | |
257 | -// catch(Exception e) { | |
258 | -// log.error(String.format("ErrorMessage=%s,UserId=%s",e.getMessage(),req.getUserId()), e); | |
259 | -// sendError(e.getMessage()); | |
260 | -// } | |
261 | -// } | |
262 | -// | |
263 | -// /** | |
264 | -// * 获取通知 | |
265 | -// * | |
266 | -// * @createTime 2015年10月27日 下午3:58:35 | |
267 | -// * @author duanyugen | |
268 | -// */ | |
269 | -// @RequestMapping("getNotice") | |
270 | -// @ResponseBody | |
271 | -// public void getAgreement(HttpServletRequest request){ | |
272 | -// try { | |
273 | -// GetNoticeResp resp = commonService.getNotice(); | |
274 | -// sendSuccessResp(resp); | |
275 | -// } catch (ServiceException e) { | |
276 | -// log.error("获取通知异常", e); | |
277 | -// super.sendError(e.getCode(), e.getMessage()); | |
278 | -// } catch (Exception e) { | |
279 | -// log.error("获取通知异常", e); | |
280 | -// super.sendError(e.getMessage()); | |
281 | -// } | |
282 | -// } | |
283 | -// | |
284 | -// /** | |
285 | -// * 获取自贸区列表 | |
286 | -// */ | |
287 | -// @RequestMapping("getFATlist") | |
288 | -// @ResponseBody | |
289 | -// public void getFATlist(){ | |
290 | -// GetSystemConfigReq req = getRequest(GetSystemConfigReq.class); | |
291 | -// try { | |
292 | -// GetFATlistResp resp = commonService.getFATlist(req.getCode()); | |
293 | -// sendSuccessResp(resp); | |
294 | -// } catch (Exception e) { | |
295 | -// log.error(String.format("获取自贸区列表[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
296 | -// sendError(e.getMessage()); | |
297 | -// } | |
298 | -// } | |
299 | -// | |
300 | -// | |
301 | -//} | |
1 | +package com.diligrp.mobsite.getway.web.api.base; | |
2 | + | |
3 | +import com.diligrp.mobsite.getway.domain.except.ServiceException; | |
4 | +import com.diligrp.mobsite.getway.domain.protocol.common.*; | |
5 | +import com.diligrp.mobsite.getway.rpc.buyer.impl.StoreRPCImpl; | |
6 | +import com.diligrp.mobsite.getway.service.common.CommonService; | |
7 | +import com.diligrp.website.util.security.Validator; | |
8 | +import io.swagger.annotations.Api; | |
9 | +import io.swagger.annotations.ApiOperation; | |
10 | +import org.slf4j.Logger; | |
11 | +import org.slf4j.LoggerFactory; | |
12 | +import org.springframework.stereotype.Controller; | |
13 | +import org.springframework.web.bind.annotation.*; | |
14 | + | |
15 | +import javax.annotation.Resource; | |
16 | + | |
17 | +/** | |
18 | + * <B>Description</B> 公共Controller <br /> | |
19 | + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br /> | |
20 | + * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br /> | |
21 | + * <B>Company</B> 地利集团 | |
22 | + * @createTime Aug 5, 2014 5:34:08 PM | |
23 | + * @author zhangshirui | |
24 | + */ | |
25 | +@Controller | |
26 | +@RequestMapping("/mobsiteApp/common") | |
27 | +@Api(value = "/mobsiteApp/common", description = "公共:城市信息,上传图片等") | |
28 | + | |
29 | +public class CommonController extends BaseApiController { | |
30 | + | |
31 | + | |
32 | + @Resource | |
33 | + private CommonService commonService; | |
34 | + | |
35 | + private Logger log = LoggerFactory.getLogger(getClass()); | |
36 | + | |
37 | + | |
38 | + /** | |
39 | + * 根据城市id查询城市信息 | |
40 | + */ | |
41 | + @ApiOperation(value = "根据城市id查询城市信息", httpMethod = "POST",response = GetCityResp.class) | |
42 | + @RequestMapping(value = "/getCity",method = RequestMethod.POST) | |
43 | + @ResponseBody | |
44 | + public void getCity(@ModelAttribute GetCityReq temp) { | |
45 | + GetCityReq req = getRequest(GetCityReq.class); | |
46 | + try { | |
47 | + GetCityResp resp = commonService.getCity(Validator.isNull(req) ? 0 : req.getCityId()); | |
48 | + sendSuccessResp(resp); | |
49 | + } catch (Exception e) { | |
50 | + log.error(String.format("获取国内城市接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
51 | + sendError(e.getMessage()); | |
52 | + } | |
53 | + } | |
54 | + | |
55 | + /** | |
56 | + * 根据城市id查询城市信息 | |
57 | + */ | |
58 | + @ApiOperation(value = "根据城市id查询城市信息", httpMethod = "POST",response = GetCitysResp.class) | |
59 | + @RequestMapping(value = "/getCitys",method = RequestMethod.POST) | |
60 | + @ResponseBody | |
61 | + public void getCitys(@ModelAttribute GetCitysReq temp) { | |
62 | + GetCitysReq req = getRequest(GetCitysReq.class); | |
63 | + try { | |
64 | + GetCitysResp resp = commonService.getCitys(req); | |
65 | + sendSuccessResp(resp); | |
66 | + } catch (Exception e) { | |
67 | + log.error(String.format("获取城市接口[msg=%s]",e.getMessage()), e); | |
68 | + sendError(e.getMessage()); | |
69 | + } | |
70 | + } | |
71 | + | |
72 | + /** | |
73 | + * 获取国家的城市信息,目前只支持国内城市与国家名 | |
74 | + * 0:是所有 | |
75 | + * -10:中国 | |
76 | + * -9999:海外 | |
77 | + */ | |
78 | + @ApiOperation(value = "获取国家的城市信息,目前只支持国内城市与国家名:0:是所有,-10:中国,-9999:海外", httpMethod = "POST",response =GetCityResp.class ) | |
79 | + @RequestMapping(value = "/getCountry",method = RequestMethod.POST) | |
80 | + @ResponseBody | |
81 | + public void getCountry(@ModelAttribute GetCityReq temp) { | |
82 | + GetCityReq req = getRequest(GetCityReq.class); | |
83 | + try { | |
84 | + GetCityResp resp = commonService.getCountry(Validator.isNull(req) || Validator.isNull(req.getCityId()) | |
85 | + ? 0 : req.getCityId()); | |
86 | + sendSuccessResp(resp); | |
87 | + } catch (Exception e) { | |
88 | + log.error(String.format("获取国家和城市接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
89 | + sendError(e.getMessage()); | |
90 | + } | |
91 | + } | |
92 | + | |
93 | + | |
94 | + /** | |
95 | + * 获取国家的所有城市信息,目前只支持国内城市与国家名 | |
96 | + */ | |
97 | + @ApiOperation(value = "获取国家的城市信息,目前只支持国内城市与国家名", httpMethod = "POST",response = GetAllCountryTreeResp.class) | |
98 | + @RequestMapping(value = "/getAllCountryTree",method = RequestMethod.POST) | |
99 | + @ResponseBody | |
100 | + public void getAllCountryTree(@ModelAttribute GetCityReq temp) { | |
101 | + GetCityReq req = getRequest(GetCityReq.class); | |
102 | + try { | |
103 | + GetAllCountryTreeResp resp = commonService.getAllCountryTree(); | |
104 | + sendSuccessResp(resp); | |
105 | + } catch (Exception e) { | |
106 | + log.error(String.format("获取国家和城市接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
107 | + sendError(e.getMessage()); | |
108 | + } | |
109 | + } | |
110 | + | |
111 | + | |
112 | + /** | |
113 | + * 获取单位信息 | |
114 | + * | |
115 | + * getUnitInfo | |
116 | + * | |
117 | + * GetUnitInfoReq | |
118 | + * GetUnitInfoResp | |
119 | + */ | |
120 | + //@RequestMapping("getUnitInfo") | |
121 | + //@ResponseBody | |
122 | + //public void getUnitInfo() { | |
123 | + // GetUnitInfoReq req = getRequest(GetUnitInfoReq.class); | |
124 | + // try { | |
125 | + // GetUnitInfoResp resp = commonService.getUnitInfo(req); | |
126 | + // sendSuccessResp(resp); | |
127 | + // } catch (Exception e) { | |
128 | + // log.error(String.format("获取单位信息接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
129 | + // sendError(e.getMessage()); | |
130 | + // } | |
131 | + //} | |
132 | + | |
133 | + /** | |
134 | + * 上传图片 | |
135 | + * | |
136 | + * uploadImg | |
137 | + */ | |
138 | + @ApiOperation(value = "上传图片", httpMethod = "POST") | |
139 | + @RequestMapping(value = "/uploadImg",method = RequestMethod.POST) | |
140 | + @ResponseBody | |
141 | + public void uploadImg(@RequestBody byte[] file){ | |
142 | + sendJSON(uploadFile(file,StoreRPCImpl.BUDGET_NAME_IMAGES,StoreRPCImpl.FILE_TYPE_IMGE)); | |
143 | + } | |
144 | + | |
145 | + ///** | |
146 | + // * 上传图片,获取全部url | |
147 | + // * | |
148 | + // * uploadImgFullUrl | |
149 | + // */ | |
150 | + //@RequestMapping("uploadImgFullUrl") | |
151 | + //@ResponseBody | |
152 | + //public void uploadImgFullUrl(@RequestParam("files") MultipartFile[] files){ | |
153 | + // | |
154 | + // try { | |
155 | + // List<UploadFileResp> listResp = new ArrayList<>(); | |
156 | + // for (MultipartFile file : files) { | |
157 | + // UploadFileResp resp = uploadFile(file.getBytes(),StoreRPCImpl.BUDGET_NAME_IMAGES,StoreRPCImpl.FILE_TYPE_IMGE); | |
158 | + // listResp.add(resp); | |
159 | + // } | |
160 | + // sendJSON(listResp); | |
161 | + // } catch (IOException e) { | |
162 | + // log.error(String.format("上传图片接口[msg=%s]",e.getMessage()), e); | |
163 | + // sendError(e.getMessage()); | |
164 | + // } | |
165 | + //} | |
166 | + // | |
167 | + ///** | |
168 | + // * 上传音频 | |
169 | + // * | |
170 | + // */ | |
171 | + //@RequestMapping("uploadAudio") | |
172 | + //@ResponseBody | |
173 | + //public void uploadAudio(@RequestBody byte[] file){ | |
174 | + // sendJSON(uploadFile(file, StoreRPCImpl.BUDGET_NAME_MESSAGE,StoreRPCImpl.FILE_TYPE_AUDIO)); | |
175 | + //} | |
176 | + | |
177 | + private UploadFileResp uploadFile(@RequestBody byte[] file,String bucket,String fileType) { | |
178 | + try { | |
179 | + return commonService.uploadFiles(file, bucket,fileType); | |
180 | + }catch(ServiceException e){ | |
181 | + log.error(String.format("Code=%s,ErrorMessage=%s", | |
182 | + e.getCode(), e.getMessage()), e); | |
183 | + super.sendError(e.getCode(), e.getMessage()); | |
184 | + } catch (Exception e) { | |
185 | + log.error(String.format("上传文件错误[msg=%s]",e.getMessage()), e); | |
186 | + sendError(e.getMessage()); | |
187 | + } | |
188 | + return null; | |
189 | + } | |
190 | + | |
191 | + ///** | |
192 | + // * 获取字典信息 | |
193 | + // */ | |
194 | + //@ApiOperation(value = "获取数据字典信息", httpMethod = "POST") | |
195 | + //@RequestMapping(value = "/getSystemConfig",method = RequestMethod.POST) | |
196 | + //@ResponseBody | |
197 | + //public void getSystemConfig(){ | |
198 | + // GetSystemConfigReq req = getRequest(GetSystemConfigReq.class); | |
199 | + // if (Validator.isNull(req.getCode())) { | |
200 | + // sendError(ErrorMessage.COMMON_REQUEST_PARAM_ERROR); | |
201 | + //} | |
202 | + // try { | |
203 | + // GetSystemConfigResp resp = commonService.getDicInfoByCode(req.getCode()); | |
204 | + // sendSuccessResp(resp); | |
205 | + // } catch (Exception e) { | |
206 | + // log.error(String.format("获取国家和城市接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
207 | + // sendError(e.getMessage()); | |
208 | + // } | |
209 | + //} | |
210 | + // | |
211 | + ///** | |
212 | + // * 获取首页统计信息 | |
213 | + // */ | |
214 | + //@RequestMapping("getHomeStatistics") | |
215 | + //@ResponseBody | |
216 | + //public void getHomeStatistics(){ | |
217 | + // GetHomeStatisticsReq req = getRequest(GetHomeStatisticsReq.class); | |
218 | + // try { | |
219 | + // GetHomeStatisticsResp resp = commonService.getHomeStatistics(req); | |
220 | + // sendSuccessResp(resp); | |
221 | + // } catch (Exception e) { | |
222 | + // log.error(String.format("获取国家和城市接口[msg=%s,UserId=%s]",e.getMessage(),req.getUserId()), e); | |
223 | + // sendError(e.getMessage()); | |
224 | + // } | |
225 | + //} | |
226 | + // | |
227 | + ///** | |
228 | + // * 根据数据字典code获取全部的数据字典 | |
229 | + // */ | |
230 | + //@RequestMapping("getDics") | |
231 | + //@ResponseBody | |
232 | + //public void getDics(){ | |
233 | + // GetDicsReq req = getRequest(GetDicsReq.class); | |
234 | + // try { | |
235 | + // GetDicsResp resp = commonService.getDics(req); | |
236 | + // sendSuccessResp(resp); | |
237 | + // } catch (Exception e) { | |
238 | + // log.error(String.format("获取数据字典接口[msg=%s,UserId=%s]",e.getMessage(),req.getCode()), e); | |
239 | + // sendError(e.getMessage()); | |
240 | + // } | |
241 | + //} | |
242 | + | |
243 | + /** | |
244 | + * 获取协议地址协议 | |
245 | + * @createTime 2015年6月9日 下午3:52:12 | |
246 | + * @author zhangshirui | |
247 | + */ | |
248 | + //@ApiOperation(value = "获取协议地址协议", httpMethod = "POST",response = GetAgreementUrlResp.class) | |
249 | + //@RequestMapping(value = "/getAgreementUrl",method = RequestMethod.POST) | |
250 | + //@ResponseBody | |
251 | + //public void getAgreementUrl(@ModelAttribute GetAgreementUrlReq temp) { | |
252 | + // GetAgreementUrlReq req = getRequest(GetAgreementUrlReq.class); | |
253 | + // try { | |
254 | + // GetAgreementUrlResp resp = commonService.getAgreementUrl(req); | |
255 | + // sendSuccessResp(resp); | |
256 | + // } | |
257 | + // catch(Exception e) { | |
258 | + // log.error(String.format("ErrorMessage=%s,UserId=%s",e.getMessage(),req.getUserId()), e); | |
259 | + // sendError(e.getMessage()); | |
260 | + // } | |
261 | + //} | |
262 | + | |
263 | + | |
264 | + | |
265 | + | |
266 | + | |
267 | +} | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/cart/CartController.java
... | ... | @@ -12,7 +12,7 @@ import io.swagger.annotations.ApiOperation; |
12 | 12 | import org.slf4j.Logger; |
13 | 13 | import org.slf4j.LoggerFactory; |
14 | 14 | import org.springframework.stereotype.Controller; |
15 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
15 | +import org.springframework.web.bind.annotation.RequestBody; | |
16 | 16 | import org.springframework.web.bind.annotation.RequestMapping; |
17 | 17 | import org.springframework.web.bind.annotation.RequestMethod; |
18 | 18 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -30,7 +30,7 @@ import javax.annotation.Resource; |
30 | 30 | */ |
31 | 31 | @Controller |
32 | 32 | @RequestMapping("/mobsiteApp/cart") |
33 | -@Api(value = "cart", description = "菜篮子接口") | |
33 | +@Api(value = "mobsiteApp-cart", description = "菜篮子接口") | |
34 | 34 | public class CartController extends BaseApiController { |
35 | 35 | @Resource |
36 | 36 | private CartService cartService; |
... | ... | @@ -43,7 +43,7 @@ public class CartController extends BaseApiController { |
43 | 43 | @ApiOperation(value = "购物车列表", httpMethod = "POST",response = GetCartByUserResp.class) |
44 | 44 | @RequestMapping(value = "/getCartByUser",method = RequestMethod.POST) |
45 | 45 | @ResponseBody |
46 | - public void getCartByUser(@ModelAttribute GetCartByUserReq temp) { | |
46 | + public void getCartByUser(@RequestBody GetCartByUserReq temp) { | |
47 | 47 | GetCartByUserReq req = getRequest(GetCartByUserReq.class); |
48 | 48 | try { |
49 | 49 | GetCartByUserResp resp = cartService.getCart(req); |
... | ... | @@ -63,7 +63,7 @@ public class CartController extends BaseApiController { |
63 | 63 | @ApiOperation(value = "添加商品到购物车", httpMethod = "POST",response = AddCartProductResp.class) |
64 | 64 | @RequestMapping(value = "/addCartProduct",method = RequestMethod.POST) |
65 | 65 | @ResponseBody |
66 | - public void addCartProduct(@ModelAttribute AddCartProductReq temp) { | |
66 | + public void addCartProduct(@RequestBody AddCartProductReq temp) { | |
67 | 67 | AddCartProductReq req = getRequest(AddCartProductReq.class); |
68 | 68 | try { |
69 | 69 | BeanValidator.validator(req); |
... | ... | @@ -117,7 +117,7 @@ public class CartController extends BaseApiController { |
117 | 117 | @ApiOperation(value = "删除购物车中的商品", httpMethod = "POST",response = DelCartsResp.class) |
118 | 118 | @RequestMapping(value = "/delCartByIds",method = RequestMethod.POST) |
119 | 119 | @ResponseBody |
120 | - public void delCartByIds(@ModelAttribute DelCartsReq temp) { | |
120 | + public void delCartByIds(@RequestBody DelCartsReq temp) { | |
121 | 121 | DelCartsReq req = getRequest(DelCartsReq.class); |
122 | 122 | try { |
123 | 123 | if(!Validator.isEmpty(req.getSkus())){ |
... | ... | @@ -142,7 +142,7 @@ public class CartController extends BaseApiController { |
142 | 142 | @ApiOperation(value = "修改购买数量", httpMethod = "POST",response = ModifyAmountResp.class) |
143 | 143 | @RequestMapping(value = "/modifyAmount",method = RequestMethod.POST) |
144 | 144 | @ResponseBody |
145 | - public void modifyAmount(@ModelAttribute ModifyAmountReq temp) { | |
145 | + public void modifyAmount(@RequestBody ModifyAmountReq temp) { | |
146 | 146 | ModifyAmountReq req = getRequest(ModifyAmountReq.class); |
147 | 147 | try { |
148 | 148 | ModifyAmountResp resp = cartService.modifyAmount(req); |
... | ... | @@ -168,7 +168,7 @@ public class CartController extends BaseApiController { |
168 | 168 | @ApiOperation(value = "购物车确认提交", httpMethod = "POST",response = ConfirmCartResp.class) |
169 | 169 | @RequestMapping(value = "/confirmCartInfo",method = RequestMethod.POST) |
170 | 170 | @ResponseBody |
171 | - public void confirmCartInfo(@ModelAttribute ConfirmCartReq temp){ | |
171 | + public void confirmCartInfo(@RequestBody ConfirmCartReq temp){ | |
172 | 172 | ConfirmCartReq req = getRequest(ConfirmCartReq.class); |
173 | 173 | |
174 | 174 | if (Validator.isEmpty(req.getSkus())) { | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/goods/GoodsController.java
... | ... | @@ -15,7 +15,7 @@ import io.swagger.annotations.Api; |
15 | 15 | import io.swagger.annotations.ApiOperation; |
16 | 16 | import org.apache.log4j.Logger; |
17 | 17 | import org.springframework.stereotype.Controller; |
18 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
18 | +import org.springframework.web.bind.annotation.RequestBody; | |
19 | 19 | import org.springframework.web.bind.annotation.RequestMapping; |
20 | 20 | import org.springframework.web.bind.annotation.RequestMethod; |
21 | 21 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -33,7 +33,7 @@ import javax.annotation.Resource; |
33 | 33 | */ |
34 | 34 | @Controller |
35 | 35 | @RequestMapping("/mobsiteApp/goods/") |
36 | -@Api(value = "/mobsiteApp/goods", description = "商品接口-买家") | |
36 | +@Api(value = "/mobsiteApp-goods", description = "商品接口-买家") | |
37 | 37 | public class GoodsController extends BaseApiController { |
38 | 38 | |
39 | 39 | @Resource |
... | ... | @@ -50,7 +50,7 @@ public class GoodsController extends BaseApiController { |
50 | 50 | @ApiOperation(value = "商品搜索列表", httpMethod = "POST",response = SearchProductByKeywordResp.class) |
51 | 51 | @RequestMapping(value = "/searchGoodList",method = RequestMethod.POST) |
52 | 52 | @ResponseBody |
53 | - public void searchGoodList(@ModelAttribute SearchProductByKeywordReq temp) { | |
53 | + public void searchGoodList(@RequestBody SearchProductByKeywordReq temp) { | |
54 | 54 | SearchProductByKeywordReq req = super.getRequest(SearchProductByKeywordReq.class); |
55 | 55 | try { |
56 | 56 | SearchProductByKeywordResp resp = goodsService.searchGoodList(req); |
... | ... | @@ -78,7 +78,7 @@ public class GoodsController extends BaseApiController { |
78 | 78 | @ApiOperation(value = "获取商品分类", httpMethod = "POST",response = GetProductCategoryResp.class) |
79 | 79 | @RequestMapping(value = "/getProductCategory",method = RequestMethod.POST) |
80 | 80 | @ResponseBody |
81 | - public void getProductCategory(@ModelAttribute GetProductCategoryReq temp) { | |
81 | + public void getProductCategory(@RequestBody GetProductCategoryReq temp) { | |
82 | 82 | GetProductCategoryReq req = getRequest(GetProductCategoryReq.class); |
83 | 83 | try { |
84 | 84 | GetProductCategoryResp resp = goodsService.getProductCategory(req); |
... | ... | @@ -103,7 +103,7 @@ public class GoodsController extends BaseApiController { |
103 | 103 | @ApiOperation(value = "根据类别id查询商品列表", httpMethod = "POST",response = SearchProductByCategoryResp.class) |
104 | 104 | @RequestMapping(value = "/getProductByCid",method = RequestMethod.POST) |
105 | 105 | @ResponseBody |
106 | - public void getProductByCid(@ModelAttribute SearchProductByCategoryReq temp) { | |
106 | + public void getProductByCid(@RequestBody SearchProductByCategoryReq temp) { | |
107 | 107 | SearchProductByCategoryReq req = super.getRequest(SearchProductByCategoryReq.class); |
108 | 108 | try { |
109 | 109 | SearchProductByCategoryResp resp = goodsService.searchByCategory(req); |
... | ... | @@ -131,7 +131,7 @@ public class GoodsController extends BaseApiController { |
131 | 131 | @ApiOperation(value = "根据商品id查询商品详情", httpMethod = "POST",response = SearchProductByKeywordResp.class) |
132 | 132 | @RequestMapping(value = "/getProductIntroduction",method = RequestMethod.POST) |
133 | 133 | @ResponseBody |
134 | - public void getGoodsById(@ModelAttribute GetProductIntroductionReq temp) { | |
134 | + public void getGoodsById(@RequestBody GetProductIntroductionReq temp) { | |
135 | 135 | GetProductIntroductionReq req = super.getRequest(GetProductIntroductionReq.class); |
136 | 136 | try { |
137 | 137 | GetProductIntroductionResp goods = goodsService.getIntroductionById(req); | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/home/ConsigneeController.java
... | ... | @@ -9,7 +9,7 @@ import io.swagger.annotations.ApiOperation; |
9 | 9 | import org.slf4j.Logger; |
10 | 10 | import org.slf4j.LoggerFactory; |
11 | 11 | import org.springframework.stereotype.Controller; |
12 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
12 | +import org.springframework.web.bind.annotation.RequestBody; | |
13 | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
14 | 14 | import org.springframework.web.bind.annotation.RequestMethod; |
15 | 15 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -27,7 +27,7 @@ import javax.annotation.Resource; |
27 | 27 | */ |
28 | 28 | @Controller |
29 | 29 | @RequestMapping("/mobsiteApp/consignee") |
30 | -@Api(value = "/mobsiteApp/consignee", description = "收货人接口") | |
30 | +@Api(value = "/mobsiteApp-consignee", description = "收货人接口") | |
31 | 31 | public class ConsigneeController extends BaseApiController { |
32 | 32 | |
33 | 33 | @Resource |
... | ... | @@ -80,7 +80,7 @@ public class ConsigneeController extends BaseApiController { |
80 | 80 | @ApiOperation(value = "删除收货人", httpMethod = "POST",response = DelConsigneeResp.class) |
81 | 81 | @RequestMapping(value = "/delConsignee",method = RequestMethod.POST) |
82 | 82 | @ResponseBody |
83 | - public void delConsignee(@ModelAttribute DelConsigneeReq temp) { | |
83 | + public void delConsignee(@RequestBody DelConsigneeReq temp) { | |
84 | 84 | DelConsigneeReq req = getRequest(DelConsigneeReq.class); |
85 | 85 | try { |
86 | 86 | DelConsigneeResp resp = consigneeService.delConsignee(req); |
... | ... | @@ -100,7 +100,7 @@ public class ConsigneeController extends BaseApiController { |
100 | 100 | @ApiOperation(value = "修改收货人", httpMethod = "POST",response = GetConsigneeResp.class) |
101 | 101 | @RequestMapping(value = "/getConsignee",method = RequestMethod.POST) |
102 | 102 | @ResponseBody |
103 | - public void getConsignee(@ModelAttribute GetConsigneeReq temp) { | |
103 | + public void getConsignee(@RequestBody GetConsigneeReq temp) { | |
104 | 104 | GetConsigneeReq req = getRequest(GetConsigneeReq.class); |
105 | 105 | try { |
106 | 106 | GetConsigneeResp resp = consigneeService.getConsignee(req); |
... | ... | @@ -120,7 +120,7 @@ public class ConsigneeController extends BaseApiController { |
120 | 120 | @ApiOperation(value = "修改收货人", httpMethod = "POST",response = UpdateConsigneeResp.class) |
121 | 121 | @RequestMapping(value = "/updateConsignee",method = RequestMethod.POST) |
122 | 122 | @ResponseBody |
123 | - public void updateConsignee(@ModelAttribute UpdateConsigneeReq temp) { | |
123 | + public void updateConsignee(@RequestBody UpdateConsigneeReq temp) { | |
124 | 124 | UpdateConsigneeReq req = getRequest(UpdateConsigneeReq.class); |
125 | 125 | try { |
126 | 126 | UpdateConsigneeResp resp = consigneeService.updateConsignee(req); |
... | ... | @@ -140,7 +140,7 @@ public class ConsigneeController extends BaseApiController { |
140 | 140 | @ApiOperation(value = "新增收货人", httpMethod = "POST",response = AddConsigneeResp.class) |
141 | 141 | @RequestMapping(value = "/addConsignee",method = RequestMethod.POST) |
142 | 142 | @ResponseBody |
143 | - public void addConsignee(@ModelAttribute AddConsigneeReq temp) { | |
143 | + public void addConsignee(@RequestBody AddConsigneeReq temp) { | |
144 | 144 | AddConsigneeReq req = getRequest(AddConsigneeReq.class); |
145 | 145 | try { |
146 | 146 | AddConsigneeResp resp = consigneeService.addConsignee(req); |
... | ... | @@ -160,7 +160,7 @@ public class ConsigneeController extends BaseApiController { |
160 | 160 | @ApiOperation(value = "设置默认收货人", httpMethod = "POST",response = SetDefaultConsigneeReq.class) |
161 | 161 | @RequestMapping(value = "/setDefault",method = RequestMethod.POST) |
162 | 162 | @ResponseBody |
163 | - public void setDefault(@ModelAttribute SetDefaultConsigneeReq temp) { | |
163 | + public void setDefault(@RequestBody SetDefaultConsigneeReq temp) { | |
164 | 164 | SetDefaultConsigneeReq req = getRequest(SetDefaultConsigneeReq.class); |
165 | 165 | try { |
166 | 166 | SetDefaultConsigneeResp resp = consigneeService.setDefault(req.getId(),req.getUserId()); | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/home/MealDeployController.java
... | ... | @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestMethod; |
18 | 18 | |
19 | 19 | @Controller |
20 | 20 | @RequestMapping("/mobsiteApp/meal/") |
21 | -@Api(value = "/mobsiteApp/meal", description = "营养配餐接口") | |
21 | +@Api(value = "/mobsiteApp-meal", description = "营养配餐接口") | |
22 | 22 | public class MealDeployController extends BaseApiController{ |
23 | 23 | |
24 | 24 | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/home/TopicController.java
... | ... | @@ -4,11 +4,12 @@ import com.diligrp.mobsite.getway.domain.except.ServiceException; |
4 | 4 | import com.diligrp.mobsite.getway.domain.protocol.topic.*; |
5 | 5 | import com.diligrp.mobsite.getway.service.buyer.home.TopicService; |
6 | 6 | import com.diligrp.mobsite.getway.web.api.base.BaseApiController; |
7 | +import io.swagger.annotations.Api; | |
7 | 8 | import io.swagger.annotations.ApiOperation; |
8 | 9 | import org.slf4j.Logger; |
9 | 10 | import org.slf4j.LoggerFactory; |
10 | 11 | import org.springframework.stereotype.Controller; |
11 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
12 | +import org.springframework.web.bind.annotation.RequestBody; | |
12 | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
13 | 14 | import org.springframework.web.bind.annotation.RequestMethod; |
14 | 15 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -26,7 +27,8 @@ import javax.annotation.Resource; |
26 | 27 | * @author zhangshirui |
27 | 28 | */ |
28 | 29 | @Controller |
29 | -@RequestMapping("/mobsiteApp/home/") | |
30 | +@RequestMapping("/mobsiteApp/topic") | |
31 | +@Api(value = "mobsiteApp-topic",description = "首页") | |
30 | 32 | public class TopicController extends BaseApiController { |
31 | 33 | |
32 | 34 | @Resource |
... | ... | @@ -94,7 +96,7 @@ public class TopicController extends BaseApiController { |
94 | 96 | @ApiOperation(value = "首页滚动信息详情", httpMethod = "POST",response = GetHomeStatisticsTopicResp.class) |
95 | 97 | @RequestMapping(value = "/getTopicDetail",method = RequestMethod.POST) |
96 | 98 | @ResponseBody |
97 | - public void getTopicDetail(@ModelAttribute GetTopicDetailReq temp) { | |
99 | + public void getTopicDetail(@RequestBody GetTopicDetailReq temp) { | |
98 | 100 | GetTopicDetailReq req = super.getRequest(GetTopicDetailReq.class); |
99 | 101 | try { |
100 | 102 | GetTopicDetailResp resp = topicService.getTopicDetail(req); | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/shop/ShopController.java
... | ... | @@ -11,7 +11,7 @@ import io.swagger.annotations.ApiOperation; |
11 | 11 | import org.slf4j.Logger; |
12 | 12 | import org.slf4j.LoggerFactory; |
13 | 13 | import org.springframework.stereotype.Controller; |
14 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
14 | +import org.springframework.web.bind.annotation.RequestBody; | |
15 | 15 | import org.springframework.web.bind.annotation.RequestMapping; |
16 | 16 | import org.springframework.web.bind.annotation.RequestMethod; |
17 | 17 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -29,7 +29,7 @@ import javax.annotation.Resource; |
29 | 29 | */ |
30 | 30 | @Controller |
31 | 31 | @RequestMapping("/mobsiteApp/shop") |
32 | -@Api(value = "/mobsiteApp/shop", description = "店铺接口-买家") | |
32 | +@Api(value = "/mobsiteApp-shop", description = "店铺接口-买家") | |
33 | 33 | public class ShopController extends BaseApiController { |
34 | 34 | |
35 | 35 | @Resource |
... | ... | @@ -45,10 +45,10 @@ public class ShopController extends BaseApiController { |
45 | 45 | @ApiOperation(value = "获取店铺基本信息", httpMethod = "POST",response = GetShopByIdResp.class) |
46 | 46 | @RequestMapping(value = "/getShopById",method = RequestMethod.POST) |
47 | 47 | @ResponseBody |
48 | - public void getShopById() { | |
48 | + public void getShopById(@RequestBody GetShopByIdReq temp) { | |
49 | 49 | GetShopByIdReq req = getRequest(GetShopByIdReq.class); |
50 | 50 | try { |
51 | - GetShopByIdResp resp = shopServiceImpl.getById(req); | |
51 | + GetShopByIdResp resp = shopServiceImpl.getShopById(req); | |
52 | 52 | sendSuccessResp(resp); |
53 | 53 | } |
54 | 54 | catch(Exception e) { |
... | ... | @@ -63,11 +63,30 @@ public class ShopController extends BaseApiController { |
63 | 63 | @ApiOperation(value = "买家绑定店铺", httpMethod = "POST",response = BindToShopResp.class) |
64 | 64 | @RequestMapping(value = "/bindToShop",method = RequestMethod.POST) |
65 | 65 | @ResponseBody |
66 | - public void bindToShop(@ModelAttribute BindToShopReq temp) { | |
66 | + public void bindToShop(@RequestBody BindToShopReq temp) { | |
67 | 67 | BindToShopReq req = getRequest(BindToShopReq.class); |
68 | 68 | try { |
69 | 69 | BeanValidator.validator(req); |
70 | - BindToShopResp resp = shopServiceImpl.getShopIntroduction(req); | |
70 | + BindToShopResp resp = shopServiceImpl.bindToShop(req); | |
71 | + sendSuccessResp(resp); | |
72 | + } | |
73 | + catch(Exception e) { | |
74 | + log.error(String.format("ErrorMessage=%s,UserId=%s",e.getMessage(),req.getUserId()), e); | |
75 | + sendError(e.getMessage()); | |
76 | + } | |
77 | + } | |
78 | + | |
79 | + /** | |
80 | + * 买家更换绑定店铺 | |
81 | + */ | |
82 | + @ApiOperation(value = "买家更换绑定店铺", httpMethod = "POST",response = BindToShopResp.class) | |
83 | + @RequestMapping(value = "/changeBindToShop",method = RequestMethod.POST) | |
84 | + @ResponseBody | |
85 | + public void changeBindToShop(@RequestBody BindToShopReq temp) { | |
86 | + BindToShopReq req = getRequest(BindToShopReq.class); | |
87 | + try { | |
88 | + BeanValidator.validator(req); | |
89 | + BindToShopResp resp = shopServiceImpl.bindToShop(req); | |
71 | 90 | sendSuccessResp(resp); |
72 | 91 | } |
73 | 92 | catch(Exception e) { |
... | ... | @@ -82,7 +101,7 @@ public class ShopController extends BaseApiController { |
82 | 101 | @ApiOperation(value = "热门推荐", httpMethod = "POST",response = BindToShopResp.class) |
83 | 102 | @RequestMapping(value = "/getProductRecommend",method = RequestMethod.POST) |
84 | 103 | @ResponseBody |
85 | - public void getProductRecommend(@ModelAttribute GetProductRecommendReq temp) { | |
104 | + public void getProductRecommend(@RequestBody GetProductRecommendReq temp) { | |
86 | 105 | GetProductRecommendReq req = getRequest(GetProductRecommendReq.class); |
87 | 106 | GetProductRecommendResp resp = null; |
88 | 107 | try { |
... | ... | @@ -103,7 +122,7 @@ public class ShopController extends BaseApiController { |
103 | 122 | @ApiOperation(value = "获取送货配送时间段", httpMethod = "POST",response = GetShopDeliveryTimeResp.class) |
104 | 123 | @RequestMapping(value = "/getShopDeliveryTime",method = RequestMethod.POST) |
105 | 124 | @ResponseBody |
106 | - public void getShopDeliveryTime(@ModelAttribute GetShopDeliveryTimeReq temp) { | |
125 | + public void getShopDeliveryTime(@RequestBody GetShopDeliveryTimeReq temp) { | |
107 | 126 | GetShopDeliveryTimeReq req = getRequest(GetShopDeliveryTimeReq.class); |
108 | 127 | GetShopDeliveryTimeResp resp = null; |
109 | 128 | try { | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/user/OrderController.java
... | ... | @@ -6,13 +6,12 @@ import com.diligrp.mobsite.getway.service.buyer.user.OrderService; |
6 | 6 | import com.diligrp.mobsite.getway.web.api.base.BaseApiController; |
7 | 7 | import com.diligrp.mobsite.getway.web.utils.BeanValidator; |
8 | 8 | import io.swagger.annotations.Api; |
9 | +import io.swagger.annotations.ApiImplicitParam; | |
10 | +import io.swagger.annotations.ApiImplicitParams; | |
9 | 11 | import io.swagger.annotations.ApiOperation; |
10 | 12 | import org.apache.log4j.Logger; |
11 | 13 | import org.springframework.stereotype.Controller; |
12 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
13 | -import org.springframework.web.bind.annotation.RequestMapping; | |
14 | -import org.springframework.web.bind.annotation.RequestMethod; | |
15 | -import org.springframework.web.bind.annotation.ResponseBody; | |
14 | +import org.springframework.web.bind.annotation.*; | |
16 | 15 | |
17 | 16 | import javax.annotation.Resource; |
18 | 17 | import javax.servlet.http.HttpServletRequest; |
... | ... | @@ -28,7 +27,7 @@ import javax.servlet.http.HttpServletRequest; |
28 | 27 | */ |
29 | 28 | @Controller |
30 | 29 | @RequestMapping("/mobsiteApp/order/") |
31 | -@Api(value = "/mobsiteApp/order", description = "订单接口-买家") | |
30 | +@Api(value = "mobsiteApp-order", description = "订单接口-买家") | |
32 | 31 | public class OrderController extends BaseApiController { |
33 | 32 | |
34 | 33 | @Resource |
... | ... | @@ -48,8 +47,11 @@ public class OrderController extends BaseApiController { |
48 | 47 | */ |
49 | 48 | @ApiOperation(value = "获取订单列表", httpMethod = "POST",response = SearchOrderResp.class) |
50 | 49 | @RequestMapping(value = "/getOrders",method = RequestMethod.POST) |
50 | + @ApiImplicitParams({ | |
51 | + @ApiImplicitParam(paramType = "body",name = "temp",dataType = "SearchOrderReq") | |
52 | + }) | |
51 | 53 | @ResponseBody |
52 | - public void getOrders(@ModelAttribute SearchOrderReq temp){ | |
54 | + public void getOrders(@RequestBody SearchOrderReq temp){ | |
53 | 55 | |
54 | 56 | SearchOrderReq req = super.getRequest(SearchOrderReq.class); |
55 | 57 | try { |
... | ... | @@ -76,7 +78,7 @@ public class OrderController extends BaseApiController { |
76 | 78 | @ApiOperation(value = "根据订单id查询订单", httpMethod = "POST",response = GetOrderResp.class) |
77 | 79 | @RequestMapping(value = "/getOrderById",method = RequestMethod.POST) |
78 | 80 | @ResponseBody |
79 | - public void getOrderById(@ModelAttribute GetOrderReq temp){ | |
81 | + public void getOrderById(@RequestBody GetOrderReq temp){ | |
80 | 82 | |
81 | 83 | GetOrderReq req = super.getRequest(GetOrderReq.class); |
82 | 84 | try { |
... | ... | @@ -104,7 +106,7 @@ public class OrderController extends BaseApiController { |
104 | 106 | @ApiOperation(value = "提交订单", httpMethod = "POST",response = SubmitOrderResp.class) |
105 | 107 | @RequestMapping(value = "/submitOrder",method = RequestMethod.POST) |
106 | 108 | @ResponseBody |
107 | - public void submitOrder(HttpServletRequest request,@ModelAttribute SubmitOrderReq temp){ | |
109 | + public void submitOrder(HttpServletRequest request,@RequestBody SubmitOrderReq temp){ | |
108 | 110 | |
109 | 111 | SubmitOrderReq req = super.getRequest(SubmitOrderReq.class); |
110 | 112 | try { |
... | ... | @@ -138,7 +140,7 @@ public class OrderController extends BaseApiController { |
138 | 140 | @ApiOperation(value = "支付", httpMethod = "POST",response = PaymentResp.class) |
139 | 141 | @RequestMapping(value = "/payment",method = RequestMethod.POST) |
140 | 142 | @ResponseBody |
141 | - public void payment(@ModelAttribute PaymentReq temp){ | |
143 | + public void payment(@RequestBody PaymentReq temp){ | |
142 | 144 | PaymentReq req = super.getRequest(PaymentReq.class); |
143 | 145 | try { |
144 | 146 | BeanValidator.validator(req); |
... | ... | @@ -168,7 +170,7 @@ public class OrderController extends BaseApiController { |
168 | 170 | @ApiOperation(value = "取消订单", httpMethod = "POST",response = CancelOrderResp.class) |
169 | 171 | @RequestMapping(value = "/cancelOrder",method = RequestMethod.POST) |
170 | 172 | @ResponseBody |
171 | - public void cancelOrder(@ModelAttribute CancelOrderReq temp){ | |
173 | + public void cancelOrder(@RequestBody CancelOrderReq temp){ | |
172 | 174 | |
173 | 175 | CancelOrderReq req = super.getRequest(CancelOrderReq.class); |
174 | 176 | try { |
... | ... | @@ -195,7 +197,7 @@ public class OrderController extends BaseApiController { |
195 | 197 | @ApiOperation(value = "删除订单", httpMethod = "POST",response = DelOrderResp.class) |
196 | 198 | @RequestMapping(value = "/delOrder",method = RequestMethod.POST) |
197 | 199 | @ResponseBody |
198 | - public void delOrder(@ModelAttribute DelOrderReq temp){ | |
200 | + public void delOrder(@RequestBody DelOrderReq temp){ | |
199 | 201 | |
200 | 202 | DelOrderReq req = super.getRequest(DelOrderReq.class); |
201 | 203 | try { |
... | ... | @@ -223,7 +225,7 @@ public class OrderController extends BaseApiController { |
223 | 225 | @ApiOperation(value = "确认收货", httpMethod = "POST",response = ConfirmPickUpResp.class) |
224 | 226 | @RequestMapping(value = "/confirmPickUp",method = RequestMethod.POST) |
225 | 227 | @ResponseBody |
226 | - public void confirmPickUp(@ModelAttribute ConfirmPickUpReq temp){ | |
228 | + public void confirmPickUp(@RequestBody ConfirmPickUpReq temp){ | |
227 | 229 | ConfirmPickUpReq req = super.getRequest(ConfirmPickUpReq.class); |
228 | 230 | try { |
229 | 231 | ConfirmPickUpResp resp = orderService.confirmPickUp(req); | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/user/StationMsgController.java
... | ... | @@ -8,7 +8,7 @@ import io.swagger.annotations.Api; |
8 | 8 | import io.swagger.annotations.ApiOperation; |
9 | 9 | import org.apache.log4j.Logger; |
10 | 10 | import org.springframework.stereotype.Controller; |
11 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
11 | +import org.springframework.web.bind.annotation.RequestBody; | |
12 | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
13 | 13 | import org.springframework.web.bind.annotation.RequestMethod; |
14 | 14 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -26,7 +26,7 @@ import javax.annotation.Resource; |
26 | 26 | */ |
27 | 27 | @Controller |
28 | 28 | @RequestMapping("/mobsiteApp/stationMsg") |
29 | -@Api(value = "/mobsiteApp/stationMsg", description = "站内信") | |
29 | +@Api(value = "mobsiteApp-stationMsg", description = "站内信") | |
30 | 30 | public class StationMsgController extends BaseApiController { |
31 | 31 | @Resource |
32 | 32 | private StationMsgService stationMsgService; |
... | ... | @@ -42,7 +42,7 @@ public class StationMsgController extends BaseApiController { |
42 | 42 | @ApiOperation(value = "标识站内信已读", httpMethod = "POST",response = MarkStationMsgResp.class) |
43 | 43 | @RequestMapping(value = "/markStationMsg",method = RequestMethod.POST) |
44 | 44 | @ResponseBody |
45 | - public void markStationMsg(@ModelAttribute MarkStationMsgReq temp){ | |
45 | + public void markStationMsg(@RequestBody MarkStationMsgReq temp){ | |
46 | 46 | MarkStationMsgReq req = super.getRequest(MarkStationMsgReq.class); |
47 | 47 | try { |
48 | 48 | MarkStationMsgResp resp = stationMsgService.markStationMsg(req); |
... | ... | @@ -66,7 +66,7 @@ public class StationMsgController extends BaseApiController { |
66 | 66 | @ApiOperation(value = "获取站内信列表", httpMethod = "POST",response = GetStationMsgListResp.class) |
67 | 67 | @RequestMapping(value = "/getStationMsgList",method = RequestMethod.POST) |
68 | 68 | @ResponseBody |
69 | - public void getStationMsgList(@ModelAttribute GetStationMsgListReq temp){ | |
69 | + public void getStationMsgList(@RequestBody GetStationMsgListReq temp){ | |
70 | 70 | GetStationMsgListReq req = super.getRequest(GetStationMsgListReq.class); |
71 | 71 | try { |
72 | 72 | GetStationMsgListResp resp = stationMsgService.getStationMsgList(req); |
... | ... | @@ -89,7 +89,7 @@ public class StationMsgController extends BaseApiController { |
89 | 89 | @ApiOperation(value = "获取站内信首页信息", httpMethod = "POST",response = GetHomeInfoResp.class) |
90 | 90 | @RequestMapping(value = "/getHomeInfo",method = RequestMethod.POST) |
91 | 91 | @ResponseBody |
92 | - public void getHomeInfo(@ModelAttribute GetHomeInfoReq temp){ | |
92 | + public void getHomeInfo(@RequestBody GetHomeInfoReq temp){ | |
93 | 93 | GetHomeInfoReq req = super.getRequest(GetHomeInfoReq.class); |
94 | 94 | try { |
95 | 95 | GetHomeInfoResp resp = stationMsgService.getHomeInfoArray(req); | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/user/UserController.java
... | ... | @@ -13,7 +13,7 @@ import io.swagger.annotations.Api; |
13 | 13 | import io.swagger.annotations.ApiOperation; |
14 | 14 | import org.apache.log4j.Logger; |
15 | 15 | import org.springframework.stereotype.Controller; |
16 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
16 | +import org.springframework.web.bind.annotation.RequestBody; | |
17 | 17 | import org.springframework.web.bind.annotation.RequestMapping; |
18 | 18 | import org.springframework.web.bind.annotation.RequestMethod; |
19 | 19 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -32,7 +32,7 @@ import javax.servlet.http.HttpServletRequest; |
32 | 32 | */ |
33 | 33 | @Controller |
34 | 34 | @RequestMapping("/mobsiteApp/user") |
35 | -@Api(value = "/mobsiteApp/user", description = "用户接口") | |
35 | +@Api(value = "/mobsiteApp-user", description = "用户接口-买家") | |
36 | 36 | public class UserController extends BaseApiController { |
37 | 37 | |
38 | 38 | @Resource |
... | ... | @@ -48,7 +48,7 @@ public class UserController extends BaseApiController { |
48 | 48 | @ApiOperation(value = "买家登录", httpMethod = "POST",response = LoginResp.class) |
49 | 49 | @RequestMapping(value = "/buyerLogin",method = RequestMethod.POST) |
50 | 50 | @ResponseBody |
51 | - public void buyerLogin(HttpServletRequest request,@ModelAttribute LoginReq temp ){ | |
51 | + public void buyerLogin(HttpServletRequest request,@RequestBody LoginReq temp ){ | |
52 | 52 | LoginReq req = super.getRequest(LoginReq.class); |
53 | 53 | try { |
54 | 54 | BeanValidator.validator(req); |
... | ... | @@ -75,7 +75,7 @@ public class UserController extends BaseApiController { |
75 | 75 | @ApiOperation(value = "买家登录", httpMethod = "POST",response = LoginResp.class) |
76 | 76 | @RequestMapping(value = "/buyerLogins",method = RequestMethod.POST) |
77 | 77 | @ResponseBody |
78 | - public void buyerLogins(@ModelAttribute LoginReq temp){ | |
78 | + public void buyerLogins(@RequestBody LoginReq temp){ | |
79 | 79 | LoginReq req = super.getRequest(LoginReq.class); |
80 | 80 | try { |
81 | 81 | BeanValidator.validator(req); |
... | ... | @@ -100,7 +100,7 @@ public class UserController extends BaseApiController { |
100 | 100 | @ApiOperation(value = "买家验证码登录", httpMethod = "POST" , notes = "买家验证码登录",response = LoginResp.class) |
101 | 101 | @RequestMapping(value = "/loginForAuth",method = RequestMethod.POST) |
102 | 102 | @ResponseBody |
103 | - public void loginForAuth(@ModelAttribute LoginReq temp){ | |
103 | + public void loginForAuth(@RequestBody LoginReq temp){ | |
104 | 104 | LoginReq req = super.getRequest(LoginReq.class); |
105 | 105 | try { |
106 | 106 | BeanValidator.validator(req); |
... | ... | @@ -148,7 +148,7 @@ public class UserController extends BaseApiController { |
148 | 148 | @ApiOperation(value = "发送验证码到手机", httpMethod = "POST" , notes = "发送验证码到手机",response = SendVeriCodeResp.class) |
149 | 149 | @RequestMapping(value = "/sendAuthCode",method = RequestMethod.POST) |
150 | 150 | @ResponseBody |
151 | - public void sendAuthCode(@ModelAttribute SendVeriCodeReq temp){ | |
151 | + public void sendAuthCode(@RequestBody SendVeriCodeReq temp){ | |
152 | 152 | SendVeriCodeReq req= super.getRequest(SendVeriCodeReq.class); |
153 | 153 | try { |
154 | 154 | BeanValidator.validator(req); |
... | ... | @@ -172,7 +172,7 @@ public class UserController extends BaseApiController { |
172 | 172 | @ApiOperation(value = "验证手机收到的验证码", httpMethod = "POST" , notes = "验证手机收到的验证码",response = CheckVeriCodeResp.class) |
173 | 173 | @RequestMapping(value = "/checkAuthCode",method = RequestMethod.POST) |
174 | 174 | @ResponseBody |
175 | - public void checkAuthCode(@ModelAttribute CheckVeriCodeReq temp){ | |
175 | + public void checkAuthCode(@RequestBody CheckVeriCodeReq temp){ | |
176 | 176 | CheckVeriCodeReq req= super.getRequest(CheckVeriCodeReq.class); |
177 | 177 | try { |
178 | 178 | BeanValidator.validator(req); |
... | ... | @@ -245,7 +245,7 @@ public class UserController extends BaseApiController { |
245 | 245 | @ApiOperation(value = "找回密码-修改用户密码", httpMethod = "POST" ,response = SendVeriCodeResp.class) |
246 | 246 | @RequestMapping(value = "/modifyPwd",method = RequestMethod.POST) |
247 | 247 | @ResponseBody |
248 | - public void modifyPwd(@ModelAttribute ModifyPwdReq temp){ | |
248 | + public void modifyPwd(@RequestBody ModifyPwdReq temp){ | |
249 | 249 | ModifyPwdReq req = super.getRequest(ModifyPwdReq.class); |
250 | 250 | ModifyPwdResp resp = null; |
251 | 251 | try { |
... | ... | @@ -271,7 +271,7 @@ public class UserController extends BaseApiController { |
271 | 271 | @ApiOperation(value = "买家注册", httpMethod = "POST" ,response = UserRegisterResp.class) |
272 | 272 | @RequestMapping(value = "/buyerRegister",method = RequestMethod.POST) |
273 | 273 | @ResponseBody |
274 | - public void buyerRegister(@ModelAttribute UserRegisterReq temp){ | |
274 | + public void buyerRegister(@RequestBody UserRegisterReq temp){ | |
275 | 275 | UserRegisterReq req = super.getRequest(UserRegisterReq.class); |
276 | 276 | try { |
277 | 277 | BeanValidator.validator(req); |
... | ... | @@ -295,7 +295,7 @@ public class UserController extends BaseApiController { |
295 | 295 | @ApiOperation(value = "买家注册", httpMethod = "POST" ,response = UserRegisterResp.class) |
296 | 296 | @RequestMapping(value = "/buyerRegisters",method = RequestMethod.POST) |
297 | 297 | @ResponseBody |
298 | - public void buyerRegisters(@ModelAttribute UserRegisterReq temp){ | |
298 | + public void buyerRegisters(@RequestBody UserRegisterReq temp){ | |
299 | 299 | UserRegisterReq req = super.getRequest(UserRegisterReq.class); |
300 | 300 | try { |
301 | 301 | BeanValidator.validator(req); |
... | ... | @@ -321,7 +321,7 @@ public class UserController extends BaseApiController { |
321 | 321 | @ApiOperation(value = "退出", httpMethod = "POST" ,response = LogoutResp.class) |
322 | 322 | @RequestMapping(value = "/logout",method = RequestMethod.POST) |
323 | 323 | @ResponseBody |
324 | - public void logout(@ModelAttribute LogoutReq temp){ | |
324 | + public void logout(@RequestBody LogoutReq temp){ | |
325 | 325 | LogoutReq req = super.getRequest(LogoutReq.class); |
326 | 326 | try { |
327 | 327 | if(Validator.isNull(req) || !Validator.isNumber(req.getUserId()+"")) { |
... | ... | @@ -348,7 +348,7 @@ public class UserController extends BaseApiController { |
348 | 348 | @ApiOperation(value = "个人信息维护", httpMethod = "POST" ,response = UpdateUserInfoResp.class) |
349 | 349 | @RequestMapping(value = "/updateUserInfo",method = RequestMethod.POST) |
350 | 350 | @ResponseBody |
351 | - public void updateUserInfo(@ModelAttribute UpdateUserInfoReq temp){ | |
351 | + public void updateUserInfo(@RequestBody UpdateUserInfoReq temp){ | |
352 | 352 | UpdateUserInfoReq req = super.getRequest(UpdateUserInfoReq.class); |
353 | 353 | try { |
354 | 354 | UpdateUserInfoResp resp = userService.updateUserInfo(req); |
... | ... | @@ -420,7 +420,7 @@ public class UserController extends BaseApiController { |
420 | 420 | @ApiOperation(value = "搜索买家用户信息", httpMethod = "POST" ,response = SearchUserInfoResp.class) |
421 | 421 | @RequestMapping(value = "/searchBuyerInfo",method = RequestMethod.POST) |
422 | 422 | @ResponseBody |
423 | - public void searchBuyerInfo(@ModelAttribute SearchUserInfoReq temp) { | |
423 | + public void searchBuyerInfo(@RequestBody SearchUserInfoReq temp) { | |
424 | 424 | SearchUserInfoReq req = getRequest(SearchUserInfoReq.class); |
425 | 425 | try { |
426 | 426 | SearchUserInfoResp resp = userService.searchBuyerInfo(req); | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/seller/fund/FundController.java
... | ... | @@ -8,7 +8,7 @@ import io.swagger.annotations.Api; |
8 | 8 | import io.swagger.annotations.ApiOperation; |
9 | 9 | import org.apache.log4j.Logger; |
10 | 10 | import org.springframework.stereotype.Controller; |
11 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
11 | +import org.springframework.web.bind.annotation.RequestBody; | |
12 | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
13 | 13 | import org.springframework.web.bind.annotation.RequestMethod; |
14 | 14 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -20,8 +20,8 @@ import javax.annotation.Resource; |
20 | 20 | */ |
21 | 21 | |
22 | 22 | @Controller |
23 | -@RequestMapping(value = "/mobsiteApp/seller/fund/") | |
24 | -@Api(value = "/mobsiteApp/seller/fund/",description = "储值管理") | |
23 | +@RequestMapping(value = "/mobsiteApp/seller/fund") | |
24 | +@Api(value = "mobsiteApp-seller-fund",description = "储值管理") | |
25 | 25 | public class FundController extends BaseApiController{ |
26 | 26 | |
27 | 27 | |
... | ... | @@ -72,7 +72,7 @@ public class FundController extends BaseApiController{ |
72 | 72 | @ApiOperation(value = "储值卡操作", httpMethod = "POST",response = FundTradeResp.class) |
73 | 73 | @RequestMapping(value = "/fundTrade",method = RequestMethod.POST) |
74 | 74 | @ResponseBody |
75 | - public void fundTrade(@ModelAttribute FundTradeReq temp) { | |
75 | + public void fundTrade(@RequestBody FundTradeReq temp) { | |
76 | 76 | |
77 | 77 | FundTradeReq req = super.getRequest(FundTradeReq.class); |
78 | 78 | try { |
... | ... | @@ -101,7 +101,7 @@ public class FundController extends BaseApiController{ |
101 | 101 | @ApiOperation(value = "获取储值/交易记录", httpMethod = "POST",response = GetfundTradeRecordResp.class) |
102 | 102 | @RequestMapping(value = "/getfundTradeRecord",method = RequestMethod.POST) |
103 | 103 | @ResponseBody |
104 | - public void getfundTradeRecord(@ModelAttribute GetfundTradeRecordReq temp) { | |
104 | + public void getfundTradeRecord(@RequestBody GetfundTradeRecordReq temp) { | |
105 | 105 | |
106 | 106 | GetfundTradeRecordReq req = super.getRequest(GetfundTradeRecordReq.class); |
107 | 107 | try { | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/seller/order/SellerOrderController.java
... | ... | @@ -10,7 +10,7 @@ import io.swagger.annotations.Api; |
10 | 10 | import io.swagger.annotations.ApiOperation; |
11 | 11 | import org.apache.log4j.Logger; |
12 | 12 | import org.springframework.stereotype.Controller; |
13 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
13 | +import org.springframework.web.bind.annotation.RequestBody; | |
14 | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
15 | 15 | import org.springframework.web.bind.annotation.RequestMethod; |
16 | 16 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -27,8 +27,8 @@ import javax.annotation.Resource; |
27 | 27 | * @author weili |
28 | 28 | */ |
29 | 29 | @Controller |
30 | -@RequestMapping("/mobsiteApp/seller/order/") | |
31 | -@Api(value = "/mobsiteApp/seller/order", description = "订单接口-卖家") | |
30 | +@RequestMapping("/mobsiteApp/seller/order") | |
31 | +@Api(value = "/mobsiteApp-order-seller", description = "订单接口-卖家") | |
32 | 32 | public class SellerOrderController extends BaseApiController { |
33 | 33 | |
34 | 34 | @Resource |
... | ... | @@ -49,7 +49,7 @@ public class SellerOrderController extends BaseApiController { |
49 | 49 | @ApiOperation(value = "获取订单列表", httpMethod = "POST",response = GetOrderListResp.class) |
50 | 50 | @RequestMapping(value = "/getOrders",method = RequestMethod.POST) |
51 | 51 | @ResponseBody |
52 | - public void getOrders(@ModelAttribute GetOrderListReq temp) { | |
52 | + public void getOrders(@RequestBody GetOrderListReq temp) { | |
53 | 53 | |
54 | 54 | GetOrderListReq req = super.getRequest(GetOrderListReq.class); |
55 | 55 | try { |
... | ... | @@ -76,7 +76,7 @@ public class SellerOrderController extends BaseApiController { |
76 | 76 | @ApiOperation(value = "根据订单id查询订单", httpMethod = "POST",response = GetOrderDetailResp.class) |
77 | 77 | @RequestMapping(value = "/getOrderById",method = RequestMethod.POST) |
78 | 78 | @ResponseBody |
79 | - public void getOrderById(@ModelAttribute GetOrderDetailReq temp) { | |
79 | + public void getOrderById(@RequestBody GetOrderDetailReq temp) { | |
80 | 80 | |
81 | 81 | GetOrderDetailReq req = super.getRequest(GetOrderDetailReq.class); |
82 | 82 | try { |
... | ... | @@ -105,7 +105,7 @@ public class SellerOrderController extends BaseApiController { |
105 | 105 | @ApiOperation(value = "搜索订单列表", httpMethod = "POST",response = SearchOrderListResp.class) |
106 | 106 | @RequestMapping(value = "/searchOrders",method = RequestMethod.POST) |
107 | 107 | @ResponseBody |
108 | - public void searchOrders(@ModelAttribute SearchOrderListReq temp) { | |
108 | + public void searchOrders(@RequestBody SearchOrderListReq temp) { | |
109 | 109 | |
110 | 110 | SearchOrderListReq req = super.getRequest(SearchOrderListReq.class); |
111 | 111 | try { |
... | ... | @@ -132,7 +132,7 @@ public class SellerOrderController extends BaseApiController { |
132 | 132 | @ApiOperation(value = "确认收款", httpMethod = "POST",response = ConfirmReceiptMoneyResp.class) |
133 | 133 | @RequestMapping(value = "/comfirmReceiveMoney",method = RequestMethod.POST) |
134 | 134 | @ResponseBody |
135 | - public void comfirmReceiveMoney(@ModelAttribute ConfirmReceiptMoneyReq temp) { | |
135 | + public void comfirmReceiveMoney(@RequestBody ConfirmReceiptMoneyReq temp) { | |
136 | 136 | ConfirmReceiptMoneyReq req = super.getRequest(ConfirmReceiptMoneyReq.class); |
137 | 137 | try { |
138 | 138 | ConfirmReceiptMoneyResp resp = sellerOrderService.comfirmReceiveMoney(req); |
... | ... | @@ -161,7 +161,7 @@ public class SellerOrderController extends BaseApiController { |
161 | 161 | @ApiOperation(value = "接单", httpMethod = "POST",response = CancelOrderResp.class) |
162 | 162 | @RequestMapping(value = "/takeOrder",method = RequestMethod.POST) |
163 | 163 | @ResponseBody |
164 | - public void takeOrder(@ModelAttribute takeOrderReq temp) { | |
164 | + public void takeOrder(@RequestBody takeOrderReq temp) { | |
165 | 165 | takeOrderReq req = super.getRequest(takeOrderReq.class); |
166 | 166 | try { |
167 | 167 | BaseResp resp = sellerOrderService.takeOrder(req); |
... | ... | @@ -188,7 +188,7 @@ public class SellerOrderController extends BaseApiController { |
188 | 188 | @ApiOperation(value = "拒绝接单", httpMethod = "POST",response = CancelOrderResp.class) |
189 | 189 | @RequestMapping(value = "/refuseOrder",method = RequestMethod.POST) |
190 | 190 | @ResponseBody |
191 | - public void refuseOrder(@ModelAttribute RefuseQuoteReq temp) { | |
191 | + public void refuseOrder(@RequestBody RefuseQuoteReq temp) { | |
192 | 192 | RefuseQuoteReq req = super.getRequest(RefuseQuoteReq.class); |
193 | 193 | try { |
194 | 194 | RefuseQuoteResp resp = sellerOrderService.refuseOrder(req); | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/seller/product/SellerGoodsController.java
... | ... | @@ -8,7 +8,7 @@ import io.swagger.annotations.Api; |
8 | 8 | import io.swagger.annotations.ApiOperation; |
9 | 9 | import org.apache.log4j.Logger; |
10 | 10 | import org.springframework.stereotype.Controller; |
11 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
11 | +import org.springframework.web.bind.annotation.RequestBody; | |
12 | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
13 | 13 | import org.springframework.web.bind.annotation.RequestMethod; |
14 | 14 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -25,7 +25,7 @@ import javax.annotation.Resource; |
25 | 25 | */ |
26 | 26 | @Controller |
27 | 27 | @RequestMapping("/mobsiteApp/seller/goods") |
28 | -@Api(value = "/mobsiteApp/seller/goods", description = "商品接口-卖家") | |
28 | +@Api(value = "/mobsiteApp-goods-seller", description = "商品接口-卖家") | |
29 | 29 | public class SellerGoodsController extends BaseApiController { |
30 | 30 | |
31 | 31 | @Resource |
... | ... | @@ -54,7 +54,7 @@ public class SellerGoodsController extends BaseApiController { |
54 | 54 | @ApiOperation(value = "添加商品分类", httpMethod = "POST",response = AddProductCategoryResp.class) |
55 | 55 | @RequestMapping(value = "/addProductCategory",method = RequestMethod.POST) |
56 | 56 | @ResponseBody |
57 | - public void addProductCategory(@ModelAttribute AddProductCategoryReq temp) { | |
57 | + public void addProductCategory(@RequestBody AddProductCategoryReq temp) { | |
58 | 58 | AddProductCategoryReq req = getRequest(AddProductCategoryReq.class); |
59 | 59 | try { |
60 | 60 | AddProductCategoryResp resp = sellerGoodsService.addProductCategory(req); |
... | ... | @@ -82,7 +82,7 @@ public class SellerGoodsController extends BaseApiController { |
82 | 82 | @ApiOperation(value = "修改商品分类", httpMethod = "POST",response = UpdateProductCategoryResp.class) |
83 | 83 | @RequestMapping(value = "/updateProductCategory",method = RequestMethod.POST) |
84 | 84 | @ResponseBody |
85 | - public void updateProductCategory(@ModelAttribute UpdateProductCategoryReq temp) { | |
85 | + public void updateProductCategory(@RequestBody UpdateProductCategoryReq temp) { | |
86 | 86 | UpdateProductCategoryReq req = getRequest(UpdateProductCategoryReq.class); |
87 | 87 | try { |
88 | 88 | UpdateProductCategoryResp resp = sellerGoodsService.updateProductCategory(req); |
... | ... | @@ -110,7 +110,7 @@ public class SellerGoodsController extends BaseApiController { |
110 | 110 | @ApiOperation(value = "搜索商品分类", httpMethod = "POST",response = SearchProductCategoryResp.class) |
111 | 111 | @RequestMapping(value = "/searchProductCategory",method = RequestMethod.POST) |
112 | 112 | @ResponseBody |
113 | - public void searchProductCategory(@ModelAttribute SearchProductCategoryReq temp) { | |
113 | + public void searchProductCategory(@RequestBody SearchProductCategoryReq temp) { | |
114 | 114 | SearchProductCategoryReq req = getRequest(SearchProductCategoryReq.class); |
115 | 115 | try { |
116 | 116 | SearchProductCategoryResp resp = sellerGoodsService.searchProductCategory(req); |
... | ... | @@ -141,7 +141,7 @@ public class SellerGoodsController extends BaseApiController { |
141 | 141 | @ApiOperation(value = "添加新商品", httpMethod = "POST",response = AddGoodsResp.class) |
142 | 142 | @RequestMapping(value = "/addGoods",method = RequestMethod.POST) |
143 | 143 | @ResponseBody |
144 | - public void addGoods(@ModelAttribute AddGoodsReq temp) { | |
144 | + public void addGoods(@RequestBody AddGoodsReq temp) { | |
145 | 145 | AddGoodsReq req = getRequest(AddGoodsReq.class); |
146 | 146 | try { |
147 | 147 | AddGoodsResp resp = sellerGoodsService.addGoods(req); |
... | ... | @@ -169,7 +169,7 @@ public class SellerGoodsController extends BaseApiController { |
169 | 169 | @ApiOperation(value = "修改商品", httpMethod = "POST",response = UpdateGoodsResp.class) |
170 | 170 | @RequestMapping(value = "/updateGoods",method = RequestMethod.POST) |
171 | 171 | @ResponseBody |
172 | - public void updateGoods(@ModelAttribute UpdateGoodsReq temp) { | |
172 | + public void updateGoods(@RequestBody UpdateGoodsReq temp) { | |
173 | 173 | UpdateGoodsReq req = getRequest(UpdateGoodsReq.class); |
174 | 174 | try { |
175 | 175 | UpdateGoodsResp resp = sellerGoodsService.updateGoods(req); |
... | ... | @@ -198,7 +198,7 @@ public class SellerGoodsController extends BaseApiController { |
198 | 198 | @ApiOperation(value = "卖家获取商品列表", httpMethod = "POST",response = GetGoodsResp.class) |
199 | 199 | @RequestMapping(value = "/getGoods",method = RequestMethod.POST) |
200 | 200 | @ResponseBody |
201 | - public void getGoods(@ModelAttribute GetGoodsReq temp) { | |
201 | + public void getGoods(@RequestBody GetGoodsReq temp) { | |
202 | 202 | GetGoodsReq req = getRequest(GetGoodsReq.class); |
203 | 203 | try { |
204 | 204 | GetGoodsResp resp = sellerGoodsService.getGoods(req); |
... | ... | @@ -227,7 +227,7 @@ public class SellerGoodsController extends BaseApiController { |
227 | 227 | @ApiOperation(value = "卖家操作商品:1上架 2 下架 3设置促销 4设置首页推荐 5删除", httpMethod = "POST",response = HandleGoodsResp.class) |
228 | 228 | @RequestMapping(value = "/handleGoods",method = RequestMethod.POST) |
229 | 229 | @ResponseBody |
230 | - public void handleGoods(@ModelAttribute HandleGoodsReq temp) { | |
230 | + public void handleGoods(@RequestBody HandleGoodsReq temp) { | |
231 | 231 | HandleGoodsReq req = getRequest(HandleGoodsReq.class); |
232 | 232 | try { |
233 | 233 | HandleGoodsResp resp = sellerGoodsService.handleGoods(req); | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/seller/shop/SellerShopController.java
... | ... | @@ -11,7 +11,7 @@ import io.swagger.annotations.ApiOperation; |
11 | 11 | import org.slf4j.Logger; |
12 | 12 | import org.slf4j.LoggerFactory; |
13 | 13 | import org.springframework.stereotype.Controller; |
14 | -import org.springframework.web.bind.annotation.ModelAttribute; | |
14 | +import org.springframework.web.bind.annotation.RequestBody; | |
15 | 15 | import org.springframework.web.bind.annotation.RequestMapping; |
16 | 16 | import org.springframework.web.bind.annotation.RequestMethod; |
17 | 17 | import org.springframework.web.bind.annotation.ResponseBody; |
... | ... | @@ -22,8 +22,8 @@ import javax.annotation.Resource; |
22 | 22 | * Created by weili on 2016/12/27. |
23 | 23 | */ |
24 | 24 | @Controller |
25 | -@RequestMapping("/mobsiteApp/seller/shop/") | |
26 | -@Api(value = "/mobsiteApp/seller/shop", description = "店铺接口-卖家") | |
25 | +@RequestMapping("/mobsiteApp/seller/shop") | |
26 | +@Api(value = "/mobsiteApp-shop-seller", description = "店铺接口-卖家") | |
27 | 27 | public class SellerShopController extends BaseApiController{ |
28 | 28 | |
29 | 29 | private Logger log = LoggerFactory.getLogger(getClass()); |
... | ... | @@ -37,7 +37,7 @@ public class SellerShopController extends BaseApiController{ |
37 | 37 | @ApiOperation(value = "创建或修改店铺信息", httpMethod = "POST",response = CreateOrUpdateShopResp.class) |
38 | 38 | @RequestMapping(value = "/createOrUpdateShop",method = RequestMethod.POST) |
39 | 39 | @ResponseBody |
40 | - public void createOrUpdateShop(@ModelAttribute CreateOrUpdateShopReq temp) { | |
40 | + public void createOrUpdateShop(@RequestBody CreateOrUpdateShopReq temp) { | |
41 | 41 | CreateOrUpdateShopReq req = getRequest(CreateOrUpdateShopReq.class); |
42 | 42 | try { |
43 | 43 | //BeanValidator.validator(req); |
... | ... | @@ -76,7 +76,7 @@ public class SellerShopController extends BaseApiController{ |
76 | 76 | @ApiOperation(value = "设置送货时间段", httpMethod = "POST",response = AddShopDeliveryTimeResp.class) |
77 | 77 | @RequestMapping(value = "/addShopDeliveryTime",method = RequestMethod.POST) |
78 | 78 | @ResponseBody |
79 | - public void addShopDeliveryTime(@ModelAttribute AddShopDeliveryTimeReq temp) { | |
79 | + public void addShopDeliveryTime(@RequestBody AddShopDeliveryTimeReq temp) { | |
80 | 80 | AddShopDeliveryTimeReq req = getRequest(AddShopDeliveryTimeReq.class); |
81 | 81 | try { |
82 | 82 | //BeanValidator.validator(req); |
... | ... | @@ -96,7 +96,7 @@ public class SellerShopController extends BaseApiController{ |
96 | 96 | @ApiOperation(value = "获取送货时间段", httpMethod = "POST",response = GetShopDeliveryTimeResp.class) |
97 | 97 | @RequestMapping(value = "/getShopDeliveryTime",method = RequestMethod.POST) |
98 | 98 | @ResponseBody |
99 | - public void getShopDeliveryTime(@ModelAttribute GetShopDeliveryTimeReq temp) { | |
99 | + public void getShopDeliveryTime(@RequestBody GetShopDeliveryTimeReq temp) { | |
100 | 100 | GetShopDeliveryTimeReq req = getRequest(GetShopDeliveryTimeReq.class); |
101 | 101 | try { |
102 | 102 | //BeanValidator.validator(req); |
... | ... | @@ -115,7 +115,7 @@ public class SellerShopController extends BaseApiController{ |
115 | 115 | @ApiOperation(value = "设置送货时间段", httpMethod = "POST",response = DelShopDeliveryTimeResp.class) |
116 | 116 | @RequestMapping(value = "/delShopDeliveryTime",method = RequestMethod.POST) |
117 | 117 | @ResponseBody |
118 | - public void delShopDeliveryTime(@ModelAttribute DelShopDeliveryTimeReq temp) { | |
118 | + public void delShopDeliveryTime(@RequestBody DelShopDeliveryTimeReq temp) { | |
119 | 119 | DelShopDeliveryTimeReq req = getRequest(DelShopDeliveryTimeReq.class); |
120 | 120 | try { |
121 | 121 | //BeanValidator.validator(req); | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/seller/user/SellerUserController.java
... | ... | @@ -5,9 +5,13 @@ import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginReq; |
5 | 5 | import com.diligrp.mobsite.getway.domain.protocol.saler.user.SellerLoginResp; |
6 | 6 | import com.diligrp.mobsite.getway.service.seller.SellerUserService; |
7 | 7 | import com.diligrp.mobsite.getway.web.api.base.BaseApiController; |
8 | +import io.swagger.annotations.Api; | |
9 | +import io.swagger.annotations.ApiOperation; | |
8 | 10 | import org.apache.log4j.Logger; |
9 | 11 | import org.springframework.stereotype.Controller; |
12 | +import org.springframework.web.bind.annotation.RequestBody; | |
10 | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
14 | +import org.springframework.web.bind.annotation.RequestMethod; | |
11 | 15 | import org.springframework.web.bind.annotation.ResponseBody; |
12 | 16 | |
13 | 17 | import javax.annotation.Resource; |
... | ... | @@ -23,6 +27,7 @@ import javax.annotation.Resource; |
23 | 27 | */ |
24 | 28 | @Controller |
25 | 29 | @RequestMapping("/mobsiteApp/seller/user/") |
30 | +@Api(value = "mobsiteApp-user-seller",description = "用户接口-卖家") | |
26 | 31 | public class SellerUserController extends BaseApiController { |
27 | 32 | |
28 | 33 | private final static Logger log = Logger.getLogger(SellerUserController.class); |
... | ... | @@ -35,10 +40,10 @@ public class SellerUserController extends BaseApiController { |
35 | 40 | * @createTime 2014年8月24日 下午10:55:03 |
36 | 41 | * @author duanyugen |
37 | 42 | */ |
38 | - @RequestMapping("sellerLogin") | |
43 | + @ApiOperation(value = "卖家登录", httpMethod = "POST",response = SellerLoginResp.class) | |
44 | + @RequestMapping(value = "/sellerLogin",method = RequestMethod.POST) | |
39 | 45 | @ResponseBody |
40 | - @Deprecated | |
41 | - public void sellerLogin(){ | |
46 | + public void sellerLogin(@RequestBody SellerLoginReq temp){ | |
42 | 47 | SellerLoginReq req = super.getRequest(SellerLoginReq.class); |
43 | 48 | try { |
44 | 49 | SellerLoginResp resp = sellerUserService.login(req); | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/filter/GuardLoginInterceptor.java
... | ... | @@ -4,15 +4,12 @@ import com.diligrp.manage.sdk.session.ManageConfig; |
4 | 4 | import com.diligrp.manage.sdk.session.PermissionContext; |
5 | 5 | import com.diligrp.manage.sdk.session.SessionConstants; |
6 | 6 | import com.diligrp.manage.sdk.session.SessionContext; |
7 | -import com.diligrp.manage.sdk.sessionRedis.UserResProcessor; | |
8 | -import com.diligrp.mobsite.getway.domain.common.ErrorMessage; | |
9 | 7 | import com.diligrp.mobsite.getway.domain.common.RedisKey; |
10 | 8 | import com.diligrp.mobsite.getway.domain.common.ResultCode; |
11 | 9 | import com.diligrp.mobsite.getway.domain.protocol.saler.order.GuardOperateCommonReq; |
12 | 10 | import com.diligrp.mobsite.getway.web.utils.WebContent; |
13 | 11 | import com.diligrp.website.util.redis.RedisUtil; |
14 | 12 | import com.diligrp.website.util.security.Validator; |
15 | - | |
16 | 13 | import org.nutz.json.Json; |
17 | 14 | import org.slf4j.Logger; |
18 | 15 | import org.slf4j.LoggerFactory; |
... | ... | @@ -50,14 +47,14 @@ public class GuardLoginInterceptor extends HandlerInterceptorAdapter { |
50 | 47 | @Override |
51 | 48 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
52 | 49 | //检测body是否合法 |
53 | - String body = WebContent.getRequestBody(); | |
54 | - if (Validator.isNull(body)) { | |
55 | - WebContent.sendErrorInfo(ResultCode.REQUET_PARAMS_ERROR, ErrorMessage.NETWORK_ERROR); | |
56 | - log.warn(ErrorMessage.COMMON_REQUEST_PARAM_ERROR); | |
57 | - return false; | |
58 | - } | |
59 | - | |
60 | - if(!checkTokenInfo(body,request)) return false; | |
50 | + //String body = WebContent.getRequestBody(); | |
51 | + //if (Validator.isNull(body)) { | |
52 | + // WebContent.sendErrorInfo(ResultCode.REQUET_PARAMS_ERROR, ErrorMessage.NETWORK_ERROR); | |
53 | + // log.warn(ErrorMessage.COMMON_REQUEST_PARAM_ERROR); | |
54 | + // return false; | |
55 | + //} | |
56 | + // | |
57 | + //if(!checkTokenInfo(body,request)) return false; | |
61 | 58 | |
62 | 59 | return super.preHandle(request, response, handler); |
63 | 60 | } | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/filter/LoginTimeoutInterceptor.java
... | ... | @@ -49,9 +49,9 @@ public class LoginTimeoutInterceptor extends HandlerInterceptorAdapter { |
49 | 49 | } |
50 | 50 | |
51 | 51 | //检测token信息 |
52 | - if (!checkTokenInfo(body,request)) { | |
53 | - return false; | |
54 | - } | |
52 | + //if (!checkTokenInfo(body,request)) { | |
53 | + // return false; | |
54 | + //} | |
55 | 55 | |
56 | 56 | return super.preHandle(request, response, handler); |
57 | 57 | } | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/filter/WebContentFilter.java
1 | 1 | package com.diligrp.mobsite.getway.web.filter; |
2 | 2 | |
3 | -import java.io.IOException; | |
4 | -import java.util.regex.Pattern; | |
3 | +import com.diligrp.mobsite.getway.web.utils.BodyReaderHttpServletRequestWrapper; | |
4 | +import com.diligrp.mobsite.getway.web.utils.WebContent; | |
5 | +import org.apache.commons.lang.StringUtils; | |
5 | 6 | |
6 | -import javax.servlet.Filter; | |
7 | -import javax.servlet.FilterChain; | |
8 | -import javax.servlet.FilterConfig; | |
9 | -import javax.servlet.ServletException; | |
10 | -import javax.servlet.ServletRequest; | |
11 | -import javax.servlet.ServletResponse; | |
7 | +import javax.servlet.*; | |
12 | 8 | import javax.servlet.http.HttpServletRequest; |
13 | 9 | import javax.servlet.http.HttpServletResponse; |
14 | - | |
15 | -import org.apache.commons.lang.StringUtils; | |
16 | - | |
17 | -import com.diligrp.mobsite.getway.web.utils.WebContent; | |
10 | +import java.io.IOException; | |
11 | +import java.util.regex.Pattern; | |
18 | 12 | |
19 | 13 | public class WebContentFilter implements Filter { |
20 | 14 | |
... | ... | @@ -37,9 +31,11 @@ public class WebContentFilter implements Filter { |
37 | 31 | return; |
38 | 32 | } |
39 | 33 | try { |
40 | - WebContent.put((HttpServletRequest) request); | |
34 | + HttpServletRequest requestWrapper = new BodyReaderHttpServletRequestWrapper((HttpServletRequest)request); | |
35 | + | |
36 | + WebContent.put(requestWrapper); | |
41 | 37 | WebContent.put((HttpServletResponse) response); |
42 | - chain.doFilter(request, response); | |
38 | + chain.doFilter(requestWrapper, response); | |
43 | 39 | } finally { |
44 | 40 | WebContent.clean(); |
45 | 41 | } | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/utils/BodyReaderHttpServletRequestWrapper.java
0 → 100644
1 | +package com.diligrp.mobsite.getway.web.utils; | |
2 | + | |
3 | +import javax.servlet.ServletInputStream; | |
4 | +import javax.servlet.http.HttpServletRequest; | |
5 | +import javax.servlet.http.HttpServletRequestWrapper; | |
6 | +import java.io.BufferedReader; | |
7 | +import java.io.ByteArrayInputStream; | |
8 | +import java.io.IOException; | |
9 | +import java.io.InputStreamReader; | |
10 | +import java.nio.charset.Charset; | |
11 | + | |
12 | +/** | |
13 | + * Created by xxxzzz on 2017/1/5. | |
14 | + */ | |
15 | +public class BodyReaderHttpServletRequestWrapper extends HttpServletRequestWrapper{ | |
16 | + | |
17 | + | |
18 | + private final byte[] body; | |
19 | + | |
20 | + public BodyReaderHttpServletRequestWrapper(HttpServletRequest request) throws IOException { | |
21 | + super(request); | |
22 | + body = HttpHelper.getBodyString(request).getBytes(Charset.forName("UTF-8")); | |
23 | + } | |
24 | + | |
25 | + @Override | |
26 | + public BufferedReader getReader() throws IOException { | |
27 | + return new BufferedReader(new InputStreamReader(getInputStream())); | |
28 | + } | |
29 | + | |
30 | + @Override | |
31 | + public ServletInputStream getInputStream() throws IOException { | |
32 | + | |
33 | + final ByteArrayInputStream bais = new ByteArrayInputStream(body); | |
34 | + | |
35 | + return new ServletInputStream() { | |
36 | + | |
37 | + @Override | |
38 | + public int read() throws IOException { | |
39 | + return bais.read(); | |
40 | + } | |
41 | + | |
42 | + //@Override | |
43 | + //public boolean isFinished() { | |
44 | + // return false; | |
45 | + //} | |
46 | + // | |
47 | + //@Override | |
48 | + //public boolean isReady() { | |
49 | + // return false; | |
50 | + //} | |
51 | + // | |
52 | + //@Override | |
53 | + //public void setReadListener(ReadListener readListener) { | |
54 | + // | |
55 | + //} | |
56 | + }; | |
57 | + } | |
58 | +} | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/utils/HttpHelper.java
0 → 100644
1 | +package com.diligrp.mobsite.getway.web.utils; | |
2 | + | |
3 | +import javax.servlet.ServletRequest; | |
4 | +import java.io.BufferedReader; | |
5 | +import java.io.IOException; | |
6 | +import java.io.InputStream; | |
7 | +import java.io.InputStreamReader; | |
8 | +import java.nio.charset.Charset; | |
9 | + | |
10 | +/** | |
11 | + * Created by xxxzzz on 2017/1/5. | |
12 | + */ | |
13 | +public class HttpHelper { | |
14 | + | |
15 | + /** | |
16 | + * 获取请求Body | |
17 | + * | |
18 | + * @param request | |
19 | + * @return | |
20 | + */ | |
21 | + public static String getBodyString(ServletRequest request) { | |
22 | + StringBuilder sb = new StringBuilder(); | |
23 | + InputStream inputStream = null; | |
24 | + BufferedReader reader = null; | |
25 | + try { | |
26 | + inputStream = request.getInputStream(); | |
27 | + reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8"))); | |
28 | + String line = ""; | |
29 | + while ((line = reader.readLine()) != null) { | |
30 | + sb.append(line); | |
31 | + } | |
32 | + } catch (IOException e) { | |
33 | + e.printStackTrace(); | |
34 | + } finally { | |
35 | + if (inputStream != null) { | |
36 | + try { | |
37 | + inputStream.close(); | |
38 | + } catch (IOException e) { | |
39 | + e.printStackTrace(); | |
40 | + } | |
41 | + } | |
42 | + if (reader != null) { | |
43 | + try { | |
44 | + reader.close(); | |
45 | + } catch (IOException e) { | |
46 | + e.printStackTrace(); | |
47 | + } | |
48 | + } | |
49 | + } | |
50 | + return sb.toString(); | |
51 | + } | |
52 | + | |
53 | +} | |
0 | 54 | \ No newline at end of file | ... | ... |
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/utils/WebContent.java
1 | 1 | package com.diligrp.mobsite.getway.web.utils; |
2 | 2 | |
3 | -import java.io.IOException; | |
4 | -import java.io.UnsupportedEncodingException; | |
5 | -import java.net.URLEncoder; | |
6 | -import java.util.HashMap; | |
7 | -import java.util.Map; | |
8 | - | |
9 | -import javax.servlet.http.Cookie; | |
10 | -import javax.servlet.http.HttpServletRequest; | |
11 | -import javax.servlet.http.HttpServletResponse; | |
12 | - | |
3 | +import com.diligrp.mobsite.getway.domain.common.ErrorMessage; | |
4 | +import com.diligrp.mobsite.getway.domain.common.ResultCode; | |
5 | +import com.diligrp.mobsite.getway.domain.protocol.BaseResp; | |
6 | +import com.diligrp.website.util.security.Validator; | |
13 | 7 | import org.apache.commons.io.Charsets; |
14 | 8 | import org.apache.commons.io.IOUtils; |
15 | 9 | import org.apache.commons.lang3.StringUtils; |
16 | 10 | import org.nutz.json.Json; |
17 | 11 | import org.slf4j.Logger; |
18 | 12 | import org.slf4j.LoggerFactory; |
19 | -import org.slf4j.helpers.MessageFormatter; | |
20 | 13 | import org.springframework.context.ApplicationContext; |
21 | 14 | import org.springframework.web.context.support.WebApplicationContextUtils; |
22 | -import org.springframework.web.multipart.MultipartFile; | |
23 | 15 | |
24 | -import com.alibaba.fastjson.JSONArray; | |
25 | -import com.alibaba.fastjson.JSONObject; | |
26 | -import com.dili.imageserver.sdk.service.ImageUploadService; | |
27 | -import com.dili.imageserver.sdk.service.UploadOption; | |
28 | -import com.dili.imageserver.sdk.service.UploadOption.SUPPORTED_CATEGORY_TYPE; | |
29 | -import com.dili.passport.common.model.DiliAuthTicket; | |
30 | -import com.diligrp.mobsite.getway.domain.common.ErrorMessage; | |
31 | -import com.diligrp.mobsite.getway.domain.common.ResultCode; | |
32 | -import com.diligrp.mobsite.getway.domain.protocol.BaseResp; | |
33 | -import com.diligrp.website.util.security.Validator; | |
16 | +import javax.servlet.http.Cookie; | |
17 | +import javax.servlet.http.HttpServletRequest; | |
18 | +import javax.servlet.http.HttpServletResponse; | |
19 | +import java.io.IOException; | |
20 | +import java.io.UnsupportedEncodingException; | |
21 | +import java.net.URLEncoder; | |
22 | +import java.util.HashMap; | |
23 | +import java.util.Map; | |
34 | 24 | |
35 | 25 | /** |
36 | 26 | * MVC容器 |
... | ... | @@ -182,109 +172,109 @@ public class WebContent { |
182 | 172 | e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. |
183 | 173 | } |
184 | 174 | } |
185 | - /** | |
186 | - * | |
187 | - * this method is 上传图片,返回URL (默认Category为 shop) | |
188 | - * @param image | |
189 | - * @return | |
190 | - * @createTime 2014年5月20日 下午12:09:11 | |
191 | - * @author yangweidong | |
192 | - */ | |
193 | - public static String upload(ImageUploadService imageUploadService,MultipartFile image){ | |
194 | - return upload(imageUploadService,image,SUPPORTED_CATEGORY_TYPE.SHOP,0); | |
195 | - } | |
196 | - | |
197 | - /** | |
198 | - * | |
199 | - * this method is 上传图片,返回URL | |
200 | - * @param image | |
201 | - * @return | |
202 | - * @createTime 2014年5月20日 下午12:09:11 | |
203 | - * @author yangweidong | |
204 | - */ | |
205 | - public static String upload(ImageUploadService imageUploadService,MultipartFile image, SUPPORTED_CATEGORY_TYPE category, int index){ | |
206 | - UploadOption option = new UploadOption(); | |
207 | - option.setFileName(image.getOriginalFilename()); | |
208 | - option.setImageCategory(category); | |
209 | - option.setFileLength(image.getSize()); | |
210 | - return upload(imageUploadService,option, image,index); | |
211 | - } | |
212 | - | |
213 | - /** | |
214 | - * 上传图片到图片服务器,返回第index张图片, 如果index小于0,则返回所有的切图 | |
215 | - * @param imageUploadService | |
216 | - * @param option | |
217 | - * @return | |
218 | - * @createTime 2014年7月7日 下午3:37:25 | |
219 | - * @author yangweidong | |
220 | - */ | |
221 | - public static String upload(ImageUploadService imageUploadService,UploadOption option,MultipartFile image, int index){ | |
222 | - return uploadImage(imageUploadService,option,image, index).toJSONString(); | |
223 | - } | |
224 | - | |
225 | - /** | |
226 | - * 上传图片到图片服务器,返回第一张图片 | |
227 | - * @param imageUploadService | |
228 | - * @param option | |
229 | - * @return | |
230 | - * @createTime 2014年7月7日 下午3:37:25 | |
231 | - * @author yangweidong | |
232 | - */ | |
233 | - public static String upload(ImageUploadService imageUploadService,UploadOption option,MultipartFile image){ | |
234 | - return uploadImage(imageUploadService, option, image, 0).toJSONString(); | |
235 | - } | |
236 | - | |
237 | - public static JSONObject uploadImage(ImageUploadService imageUploadService,UploadOption option,MultipartFile image, int index) { | |
238 | - | |
239 | - JSONObject jon = new JSONObject(); | |
240 | - try { | |
241 | - option.setInputStream(image.getInputStream()); | |
242 | - } catch (IOException e) { | |
243 | - if (LOGGER.isErrorEnabled()) { | |
244 | - DiliAuthTicket userInfo = DiliAuthTicket.getTicket(); | |
245 | - LOGGER.error( | |
246 | - MessageFormatter.format("上传图片失败[accountName={}]", | |
247 | - userInfo.getUsername()).getMessage(), e); | |
248 | - } | |
249 | - jon.put("success", false); | |
250 | - jon.put("message", "读取上传内容失败"); | |
251 | - return jon; | |
252 | - } | |
253 | - //{"code":0,"data":{"OriginalFileName":"11.png","absoluteImgUrl":"/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png","imgUrls":[{"imgUrl":"http://img3.dlimg.com/images/shop/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png"}],"md5":"7C3DB75E3158C6F3F76387E5EEBD3CB5"},"errorMsg":"","success":true} | |
254 | - String result = imageUploadService.uploadImage(option); | |
255 | - DiliAuthTicket userInfo = DiliAuthTicket.getTicket(); | |
256 | - if(Validator.isEmpty(result)) { | |
257 | - try { | |
258 | - LOGGER.error(MessageFormatter.format("上传图片失败[accountName={}]", userInfo.getUsername()).getMessage()); | |
259 | - } catch (Exception e) { | |
260 | - LOGGER.warn(e.getMessage(), e); | |
261 | - } | |
262 | - jon.put("success", false); | |
263 | - jon.put("message", "读取上传内容失败"); | |
264 | - return jon; | |
265 | - } | |
266 | - JSONObject object = JSONObject.parseObject(result); | |
267 | - if (!object.getBoolean("success")) { | |
268 | - if (LOGGER.isWarnEnabled()) { | |
269 | - try { | |
270 | - LOGGER.warn( | |
271 | - MessageFormatter | |
272 | - .format("上传图片失败[accountName={}, resultcode={}, resultmessage={}]", | |
273 | - userInfo.getUsername()).getMessage(), | |
274 | - object.getInteger("code"), object.getString("errorMsg")); | |
275 | - } catch (Exception e) { | |
276 | - LOGGER.warn(e.getMessage(), e ); | |
277 | - } | |
278 | - } | |
279 | - jon.put("success", false); | |
280 | - jon.put("message", object.getString("errorMsg")); | |
281 | - return jon; | |
282 | - } | |
283 | - jon.put("success", true); | |
284 | - jon.put("shortUrl", object.getJSONObject("data").getString("absoluteImgUrl")); | |
285 | - JSONArray jonArray = object.getJSONObject("data").getJSONArray("imgUrls"); | |
286 | - //{"message":"http://img3.dlimg.com/images/shop/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png","shortUrl":"/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png","success":true} | |
287 | - jon.put("message", (index < 0 ) ? jonArray:jonArray.getJSONObject(index).getString("imgUrl")); //{"message":[{"imgUrl":"http://img3.dlimg.com/images/shop/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png"}],"shortUrl":"/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png","success":true} | |
288 | - return jon; | |
289 | - } | |
175 | + ///** | |
176 | + // * | |
177 | + // * this method is 上传图片,返回URL (默认Category为 shop) | |
178 | + // * @param image | |
179 | + // * @return | |
180 | + // * @createTime 2014年5月20日 下午12:09:11 | |
181 | + // * @author yangweidong | |
182 | + // */ | |
183 | + //public static String upload(ImageUploadService imageUploadService,MultipartFile image){ | |
184 | + // return upload(imageUploadService,image,SUPPORTED_CATEGORY_TYPE.SHOP,0); | |
185 | + //} | |
186 | + // | |
187 | + ///** | |
188 | + // * | |
189 | + // * this method is 上传图片,返回URL | |
190 | + // * @param image | |
191 | + // * @return | |
192 | + // * @createTime 2014年5月20日 下午12:09:11 | |
193 | + // * @author yangweidong | |
194 | + // */ | |
195 | + //public static String upload(ImageUploadService imageUploadService,MultipartFile image, SUPPORTED_CATEGORY_TYPE category, int index){ | |
196 | + // UploadOption option = new UploadOption(); | |
197 | + // option.setFileName(image.getOriginalFilename()); | |
198 | + // option.setImageCategory(category); | |
199 | + // option.setFileLength(image.getSize()); | |
200 | + // return upload(imageUploadService,option, image,index); | |
201 | + //} | |
202 | + // | |
203 | + ///** | |
204 | + // * 上传图片到图片服务器,返回第index张图片, 如果index小于0,则返回所有的切图 | |
205 | + // * @param imageUploadService | |
206 | + // * @param option | |
207 | + // * @return | |
208 | + // * @createTime 2014年7月7日 下午3:37:25 | |
209 | + // * @author yangweidong | |
210 | + // */ | |
211 | + //public static String upload(ImageUploadService imageUploadService,UploadOption option,MultipartFile image, int index){ | |
212 | + // return uploadImage(imageUploadService,option,image, index).toJSONString(); | |
213 | + //} | |
214 | + // | |
215 | + ///** | |
216 | + // * 上传图片到图片服务器,返回第一张图片 | |
217 | + // * @param imageUploadService | |
218 | + // * @param option | |
219 | + // * @return | |
220 | + // * @createTime 2014年7月7日 下午3:37:25 | |
221 | + // * @author yangweidong | |
222 | + // */ | |
223 | + //public static String upload(ImageUploadService imageUploadService,UploadOption option,MultipartFile image){ | |
224 | + // return uploadImage(imageUploadService, option, image, 0).toJSONString(); | |
225 | + //} | |
226 | + // | |
227 | + //public static JSONObject uploadImage(ImageUploadService imageUploadService,UploadOption option,MultipartFile image, int index) { | |
228 | + // | |
229 | + // JSONObject jon = new JSONObject(); | |
230 | + // try { | |
231 | + // option.setInputStream(image.getInputStream()); | |
232 | + // } catch (IOException e) { | |
233 | + // if (LOGGER.isErrorEnabled()) { | |
234 | + // DiliAuthTicket userInfo = DiliAuthTicket.getTicket(); | |
235 | + // LOGGER.error( | |
236 | + // MessageFormatter.format("上传图片失败[accountName={}]", | |
237 | + // userInfo.getUsername()).getMessage(), e); | |
238 | + // } | |
239 | + // jon.put("success", false); | |
240 | + // jon.put("message", "读取上传内容失败"); | |
241 | + // return jon; | |
242 | + // } | |
243 | + // //{"code":0,"data":{"OriginalFileName":"11.png","absoluteImgUrl":"/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png","imgUrls":[{"imgUrl":"http://img3.dlimg.com/images/shop/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png"}],"md5":"7C3DB75E3158C6F3F76387E5EEBD3CB5"},"errorMsg":"","success":true} | |
244 | + // String result = imageUploadService.uploadImage(option); | |
245 | + // DiliAuthTicket userInfo = DiliAuthTicket.getTicket(); | |
246 | + // if(Validator.isEmpty(result)) { | |
247 | + // try { | |
248 | + // LOGGER.error(MessageFormatter.format("上传图片失败[accountName={}]", userInfo.getUsername()).getMessage()); | |
249 | + // } catch (Exception e) { | |
250 | + // LOGGER.warn(e.getMessage(), e); | |
251 | + // } | |
252 | + // jon.put("success", false); | |
253 | + // jon.put("message", "读取上传内容失败"); | |
254 | + // return jon; | |
255 | + // } | |
256 | + // JSONObject object = JSONObject.parseObject(result); | |
257 | + // if (!object.getBoolean("success")) { | |
258 | + // if (LOGGER.isWarnEnabled()) { | |
259 | + // try { | |
260 | + // LOGGER.warn( | |
261 | + // MessageFormatter | |
262 | + // .format("上传图片失败[accountName={}, resultcode={}, resultmessage={}]", | |
263 | + // userInfo.getUsername()).getMessage(), | |
264 | + // object.getInteger("code"), object.getString("errorMsg")); | |
265 | + // } catch (Exception e) { | |
266 | + // LOGGER.warn(e.getMessage(), e ); | |
267 | + // } | |
268 | + // } | |
269 | + // jon.put("success", false); | |
270 | + // jon.put("message", object.getString("errorMsg")); | |
271 | + // return jon; | |
272 | + // } | |
273 | + // jon.put("success", true); | |
274 | + // jon.put("shortUrl", object.getJSONObject("data").getString("absoluteImgUrl")); | |
275 | + // JSONArray jonArray = object.getJSONObject("data").getJSONArray("imgUrls"); | |
276 | + // //{"message":"http://img3.dlimg.com/images/shop/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png","shortUrl":"/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png","success":true} | |
277 | + // jon.put("message", (index < 0 ) ? jonArray:jonArray.getJSONObject(index).getString("imgUrl")); //{"message":[{"imgUrl":"http://img3.dlimg.com/images/shop/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png"}],"shortUrl":"/12/01/7C3DB75E3158C6F3F76387E5EEBD3CB5.png","success":true} | |
278 | + // return jon; | |
279 | + //} | |
290 | 280 | } | ... | ... |
mobsite-getway-web/src/main/resources/config.properties
... | ... | @@ -2,8 +2,8 @@ |
2 | 2 | mq.namesrvAddr=${website.messagecenter.namesrvAddr} |
3 | 3 | mq.producerGroup=${website.messagecenter.producerGroup} |
4 | 4 | |
5 | -system.shopurl.prefix=http://m.nong12.com/shop/storedetail.do?id=%s | |
6 | -system.producturl.prefix=http://m.nong12.com/goods/getIntroductionPageById.do?pid=%s | |
5 | +#system.shopurl.prefix=http://m.nong12.com/shop/storedetail.do?id=%s | |
6 | +#system.producturl.prefix=http://m.nong12.com/goods/getIntroductionPageById.do?pid=%s | |
7 | 7 | system.unname.userid=9999999999999 |
8 | 8 | |
9 | 9 | #unit: sec, defult: 30 day 2592000 |
... | ... | @@ -22,7 +22,7 @@ passport.login.passportSign=${passport.login.passportSign} |
22 | 22 | getway.log.isPrintParam=${getway.log.isPrintParam} |
23 | 23 | |
24 | 24 | #登录权限检查地址(后台配置) |
25 | -login.permission.url=http://mobapi.nong12.com/mobsiteApp/outverify/user/login.do | |
25 | +#login.permission.url=http://mobapi.nong12.com/mobsiteApp/outverify/user/login.do | |
26 | 26 | #unit: sec, defult: 24 |
27 | 27 | guardlogin.timeout.second=86400 |
28 | 28 | #供应消息过期时间 单位:天 | ... | ... |
mobsite-getway-web/src/main/resources/db.properties
1 | 1 | ##dataSource |
2 | -bonecp.driverClass=${project.dbpool.driverClass} | |
3 | -bonecp.jdbcUrl=${project.dbpool.jdbcUrl} | |
4 | -bonecp.username=${project.dbpool.username} | |
5 | -bonecp.password=${project.dbpool.password} | |
6 | -bonecp.idleConnectionTestPeriodInMinutes=${project.dbpool.idleConnectionTestPeriodInMinutes} | |
7 | -bonecp.idleMaxAgeInMinutes=${project.dbpool.idleMaxAgeInMinutes} | |
8 | -bonecp.partitionCount=${project.dbpool.partitionCount} | |
9 | -bonecp.maxConnectionsPerPartition=${project.dbpool.maxConnectionsPerPartition} | |
10 | -bonecp.minConnectionsPerPartition=${project.dbpool.minConnectionsPerPartition} | |
11 | -bonecp.acquireIncrement=${project.dbpool.acquireIncrement} | |
12 | -bonecp.statementsCacheSize=${project.dbpool.statementsCacheSize} | |
13 | -bonecp.releaseHelperThreads=${project.dbpool.releaseHelperThreads} | |
2 | + | |
14 | 3 | |
15 | 4 | jdbc.jdbcUrl=${project.dbpool.jdbcUrl} |
16 | 5 | jdbc.username=${project.dbpool.username} | ... | ... |
mobsite-getway-web/src/main/resources/log4j.xml
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | <param name="Append" value="true" /> |
13 | 13 | <param name="BufferedIO" value="true" /> |
14 | 14 | <param name="BufferSize" value="8192" /> |
15 | - <param name="File" value="${catalina.base}/logs/getway.log" /> | |
15 | + <param name="File" value="${catalina.base}/logs/gateway.log" /> | |
16 | 16 | <param name="DatePattern" value="'.'yyyy-MM-dd'.log'" /> |
17 | 17 | <layout class="org.apache.log4j.PatternLayout"> |
18 | 18 | <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss}:%p %l - %m%n" /> | ... | ... |
pom.xml
... | ... | @@ -250,11 +250,11 @@ |
250 | 250 | <version>0.0.1-SNAPSHOT</version> |
251 | 251 | </dependency> |
252 | 252 | |
253 | - <dependency> | |
254 | - <groupId>com.diligrp</groupId> | |
255 | - <artifactId>image-server-sdk</artifactId> | |
256 | - <version>1.0.10</version> | |
257 | - </dependency> | |
253 | + <!--<dependency>--> | |
254 | + <!--<groupId>com.diligrp</groupId>--> | |
255 | + <!--<artifactId>image-server-sdk</artifactId>--> | |
256 | + <!--<version>1.0.10</version>--> | |
257 | + <!--</dependency>--> | |
258 | 258 | |
259 | 259 | <dependency> |
260 | 260 | <groupId>javolution</groupId> | ... | ... |