|
@@ -1,24 +1,26 @@
|
|
package cn.jx.wechat.app.wechatrobot.config;
|
|
package cn.jx.wechat.app.wechatrobot.config;
|
|
|
|
|
|
|
|
|
|
|
|
+import org.springframework.boot.autoconfigure.http.client.HttpClientProperties;
|
|
|
|
+import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.context.annotation.Configuration;
|
|
-import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
|
|
|
-import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
|
|
@Configuration(proxyBeanMethods=true)
|
|
@Configuration(proxyBeanMethods=true)
|
|
public class RestfulConfig {
|
|
public class RestfulConfig {
|
|
|
|
|
|
- //默认RestTemplate配置工厂(采用httpclient)
|
|
|
|
- @Bean("defaultAppRestFactory")
|
|
|
|
- public HttpComponentsClientHttpRequestFactory defaultAppRestFactory(RestProperties restProperties) {
|
|
|
|
- return new ComponentsHttpClientConfigBuilder()
|
|
|
|
- .restProperties(restProperties)
|
|
|
|
- .conProp(restProperties.getMaster())
|
|
|
|
- .build();
|
|
|
|
- }
|
|
|
|
- @Bean("c")
|
|
|
|
- public RestTemplate appRestTemplate() {
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ //默认RestTemplate配置工厂(采用httpclient)
|
|
|
|
+// @Bean("defaultAppRestFactory")
|
|
|
|
+// public HttpComponentsClientHttpRequestFactory defaultAppRestFactory(RestProperties restProperties) {
|
|
|
|
+// return new ComponentsHttpClientConfigBuilder()
|
|
|
|
+// .restProperties(restProperties)
|
|
|
|
+// .conProp(restProperties.cmdcgetMaster())
|
|
|
|
+// .build();
|
|
|
|
+// }
|
|
|
|
+// @Bean("c")
|
|
|
|
+// public RestTemplate appRestTemplate() {
|
|
|
|
+//
|
|
|
|
+// }
|
|
}
|
|
}
|