Commit 40d3b3e6 by 查志伟

add

parent 1a48306b
...@@ -81,6 +81,25 @@ public class PreReleaseBeanConfig { ...@@ -81,6 +81,25 @@ public class PreReleaseBeanConfig {
return RestTemplateUtils.getRestTemplateByType(map); return RestTemplateUtils.getRestTemplateByType(map);
} }
@Profile({"pro"})
@Bean(name = {"stockRestTemplate"})
public RestTemplate stockRestTemplatePro(@Autowired StockCenterProperties stockCenterProperties) {
Map<String, Integer> map = new HashMap(16);
if (stockCenterProperties.getRetryTimes() != null) {
map.put("retryTimes", stockCenterProperties.getRetryTimes());
}
if (stockCenterProperties.getConnectTimeOut() != null) {
map.put("connectTimeOut", stockCenterProperties.getConnectTimeOut());
}
if (stockCenterProperties.getReadTimeOut() != null) {
map.put("readTimeOut", stockCenterProperties.getReadTimeOut());
}
return RestTemplateUtils.getRestTemplateByType(map);
}
@Profile({"pre-release"}) @Profile({"pre-release"})
@Bean(name = {"productRestTemplate"}) @Bean(name = {"productRestTemplate"})
public RestTemplate productRestTemplate(@Autowired ProductCenterProperties productCenterProperties) { public RestTemplate productRestTemplate(@Autowired ProductCenterProperties productCenterProperties) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment