From e8ad669f7c97d45cd23630dc101180a130d6c17e Mon Sep 17 00:00:00 2001
From: dongyukun <1208714201@qq.com>
Date: 星期二, 05 十一月 2024 10:04:57 +0800
Subject: [PATCH] tag当前值开发

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/common/utils/HttpsRequest.java |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/common/utils/HttpsRequest.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/common/utils/HttpsRequest.java
index 70901d9..3a48ae1 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/common/utils/HttpsRequest.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/common/utils/HttpsRequest.java
@@ -1,5 +1,6 @@
 package com.iailab.module.data.common.utils;
 
+import com.alibaba.fastjson.JSON;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.Header;
 import org.apache.http.HttpEntity;
@@ -122,13 +123,54 @@
      * doPost
      *
      * @param url
+     * @param jsonStr
+     * @param date
+     * @param charset
+     * @return
+     */
+    public String doPost(String url, String jsonStr, String date, String charset) {
+        org.apache.http.client.HttpClient httpClient = null;
+        HttpPost httpPost = null;
+        String result = null;
+        try {
+            httpClient = new SSLClient();
+            StringBuilder sb = new StringBuilder();
+            sb.append(url);
+            sb.append("/");
+            sb.append(date);
+            log.info("url=====" + sb.toString());
+            httpPost = new HttpPost(sb.toString());
+            //设置参数
+            httpPost.addHeader("Content-Type", "application/json;charset=UTF-8");
+            StringEntity stringEntity = new StringEntity(jsonStr);
+            stringEntity.setContentEncoding("UTF-8");
+            stringEntity.setContentType("application/json");
+            httpPost.setEntity(stringEntity);
+            HttpResponse response = httpClient.execute(httpPost);
+            if (response != null) {
+                HttpEntity resEntity = response.getEntity();
+                if (resEntity != null) {
+                    result = EntityUtils.toString(resEntity, charset);
+                }
+            }
+        } catch (Exception ex) {
+            // ex.printStackTrace();
+            log.info("doPost失败,url=" + url);
+        }
+        return result;
+    }
+
+    /**
+     * doPost
+     *
+     * @param url
      * @param map
      * @param json
      * @param charset
      * @param token
      * @return
      */
-    public String doPost(String url, Map<String, String> map, String json, String charset, String token) {
+    public String doPostForToken(String url, Map<String, String> map, String json, String charset, String token) {
         org.apache.http.client.HttpClient httpClient = null;
         HttpPost httpPost = null;
         String result = null;

--
Gitblit v1.9.3