From 1135c89deb50a080152f9086fc7b741c415ecd54 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 12 二月 2025 17:00:14 +0800
Subject: [PATCH] 通信中间件增加功能: 1、实现消息心中; 2、开阀报、关阀报、报警数据都会在消息中间件存入消息; 3、在消息中心注册消息接收者,消息中心周期性向消息接收者推送消息。
---
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/config/RestTemplateConfig.java | 41 ++++++-----------------------------------
1 files changed, 6 insertions(+), 35 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/config/RestTemplateConfig.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/config/RestTemplateConfig.java
index ae8753d..58cefe3 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/config/RestTemplateConfig.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/config/RestTemplateConfig.java
@@ -22,43 +22,8 @@
@Autowired
private RestTemplateWechatCertConfig restTemplateWechatCertConfig;
- //@Bean
- //public RestTemplate restTemplate() {
- // return new RestTemplate();
- //}
-
- //@Bean
- //public RestTemplate restTemplate() {
- // String mchid = PayInfo.mchid;
- // RestTemplate restTemplate = null;
- // try {
- // KeyStore keyStore = KeyStore.getInstance("PKCS12");
- // //InputStream cp = this.getClass().getResourceAsStream("apiclient_cert.p12");
- // FileInputStream instream = new FileInputStream(new File("C:\\webchat\\apiclient_cert.p12"));
- // keyStore.load(instream, mchid.toCharArray());
- // // Trust own CA and all self-signed certs
- // SSLContext sslcontext = SSLContextBuilder.create()
- // .loadKeyMaterial(keyStore, mchid.toCharArray())
- // .build();
- // //Allow TLSv1 protocol only
- // SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, new String[]{"TLSv1"}, null, NoopHostnameVerifier.INSTANCE);
- // CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(sslsf).build();
- // HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
- //
- // restTemplate = new RestTemplate(factory);
- // //灏嗚浆鎹㈠櫒鐨勭紪鐮佹崲鎴恥tf-8
- // restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(Charset.forName("utf-8")));
- // //System.out.println("restTemplate.hashCode():" + restTemplate.hashCode());
- // } catch (Exception e) {
- // e.printStackTrace();
- // }
- // return restTemplate;
- //}
-
- //@Bean(name = "wechatRestTemplate")
@Bean()
public RestTemplate restTemplate() throws Exception {
- //RestTemplate restTemplate = new RestTemplate(restTemplateWechatCertConfig.wechatHttpRequestFactory());
RestTemplate restTemplate = new RestTemplate(restTemplateWechatCertConfig.wechatHttpRequestFactory());
// 娣诲姞鎷︽埅鍣�
//List<ClientHttpRequestInterceptor> interceptors = new ArrayList<>();
@@ -77,4 +42,10 @@
return restTemplate;
}
+
+ //绠�鍗昍estTemplate瀹炰緥
+ @Bean
+ public RestTemplate simpleRestTemplate() {
+ return new RestTemplate();
+ }
}
\ No newline at end of file
--
Gitblit v1.8.0