chenguo 3 weeks ago
parent
commit
2117dcf3a7

+ 11 - 39
fs-service/src/main/java/com/fs/watch/utils/MyHttpUtils.java

@@ -173,8 +173,7 @@ public class MyHttpUtils {
         //创建post方式请求对象
         HttpPost httpPost = new HttpPost(path);
         //创建httpclient对象
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        try {
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
             Map<String, Object> resMap = getObjectMap(params, httpPost, httpClient);
             if ((int) resMap.get("ReturnCode") == 0) {
                 return JSONObject.parseObject(resMap.get("Data").toString(), HashMap.class);
@@ -182,15 +181,9 @@ public class MyHttpUtils {
                 return null;
             }
         } catch (Exception e) {
-
-        } finally {
-            //释放连接
-            try {
-                httpClient.close();
-            } catch (Exception e) {
-
-            }
+            System.out.println(e.getMessage());
         }
+        //释放连接
         return null;
     }
 
@@ -201,8 +194,7 @@ public class MyHttpUtils {
         //创建post方式请求对象
         HttpPost httpPost = new HttpPost(path);
         //创建httpclient对象
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        try {
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
             Map<String, Object> resMap = getObjectMap(params, httpPost, httpClient);
             if ((int) resMap.get("ReturnCode") == 0) {
                 if (resMap.get("Data") == null) {
@@ -214,14 +206,8 @@ public class MyHttpUtils {
             }
         } catch (Exception e) {
             System.out.println(e.getMessage());
-        } finally {
-            //释放连接
-            try {
-                httpClient.close();
-            } catch (Exception e) {
-
-            }
         }
+        //释放连接
         return null;
     }
 
@@ -233,8 +219,7 @@ public class MyHttpUtils {
         //创建post方式请求对象
         HttpPost httpPost = new HttpPost(path);
         //创建httpclient对象
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        try {
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
             BasicResponseHandler handler = new BasicResponseHandler();
             //设置请求格式
             String jsonData = JSONObject.toJSONString(params);
@@ -247,15 +232,9 @@ public class MyHttpUtils {
             Map<String, Object> resMap = JSONObject.parseObject(result, HashMap.class);
             return resMap;
         } catch (Exception e) {
-
-        } finally {
-            //释放连接
-            try {
-                httpClient.close();
-            } catch (Exception e) {
-
-            }
+            System.out.println(e.getMessage());
         }
+        //释放连接
         return null;
     }
 
@@ -265,8 +244,7 @@ public class MyHttpUtils {
         //创建post方式请求对象
         HttpDelete httpDelete = new HttpDelete(path);
         // 创建HTTP客户端
-        CloseableHttpClient httpClient = HttpClients.createDefault();
-        try {
+        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
 //            BasicResponseHandler handler = new BasicResponseHandler();
 //            //设置请求格式
 //            String jsonData = JSONObject.toJSONString(params);
@@ -281,15 +259,9 @@ public class MyHttpUtils {
             result.put("message", responseBody.get("msg"));
             return result;
         } catch (Exception e) {
-
-        } finally {
-            //释放连接
-            try {
-                httpClient.close();
-            } catch (Exception e) {
-
-            }
+            System.out.println(e.getMessage());
         }
+        //释放连接
         return null;
     }
 

+ 6 - 2
fs-service/src/main/resources/application-config-druid-yjb.yml

@@ -10,8 +10,8 @@ logging:
 wx:
   miniapp:
     configs:
-      - appid: wx76cb55db092a41ae   #德瑞康
-        secret: c737a27415946994e977d665d87643b3
+      - appid: wx9e61312fe7ac85c4   #德瑞康
+        secret: 63f9c2240dd09d8beff004112181e731
         token: Ncbnd7lJvkripVOpyTFAna6NAWCxCrvC
         aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
         msgDataFormat: JSON
@@ -82,8 +82,12 @@ headerImg:
   imgUrl: https://drk-1363981074.cos.ap-chongqing.myqcloud.com/fs/logo/30d7a0d1ec31e5ac16c6e96d5ca76ad.png
 ipad:
   ipadUrl: http://ipad.cdwjyyh.com
+  aiApi: http://152.136.202.157:3000/api
 wx_miniapp_temp:
   pay_order_temp_id:
   inquiry_temp_id:
+openIM:
+  secret: openIM123
+  userID: imAdmin
 
 

+ 1 - 1
fs-service/src/main/resources/application-druid-yjb.yml

@@ -1,7 +1,7 @@
 # 数据源配置
 spring:
     profiles:
-        include: config-druid-xzt,common
+        include: config-druid-yjb,common
     # redis 配置
     redis:
         # 地址