From d7fd4674d6fd40f6f7561e7e1eaac4b84bd9e974 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期五, 10 一月 2025 13:54:53 +0800 Subject: [PATCH] 将data模块中的HttpRequest util工具方法移到common中的HttpUtils中 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOClient.java | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOClient.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOClient.java index a291eea..ded8d04 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOClient.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOClient.java @@ -3,7 +3,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.iailab.module.data.common.utils.HttpRequest; +import com.iailab.framework.common.util.http.HttpUtils; import com.iailab.module.data.channel.kio.dto.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -85,7 +85,7 @@ form.put("username", username); form.put("password", password); this.logint_time = System.currentTimeMillis(); - String responseStr = HttpRequest.sendPost(this.url + "/login", JSON.toJSONString(form)); + String responseStr = HttpUtils.sendPost(this.url + "/login", JSON.toJSONString(form)); JSONObject responseObj = JSON.parseObject(responseStr); if (S_CODE != Integer.parseInt(responseObj.get(R_CODE).toString())) { bLogin = false; @@ -119,7 +119,7 @@ return bConnect; } Map<String, String> map = new HashMap<>(); - String responseStr = HttpRequest.sendPost(this.url + "/heartbeat", "", this.authorization); + String responseStr = HttpUtils.sendPost(this.url + "/heartbeat", "", this.authorization); JSONObject responseObj = JSON.parseObject(responseStr); if (S_CODE != Integer.parseInt(responseObj.get(R_CODE).toString())) { bConnect = false; @@ -139,7 +139,7 @@ Map<String, String> map = new HashMap<>(); map.put("projectInstanceName", this.instanceName); map.put("TagName", tagName); - String responseStr = HttpRequest.sendGet(this.url + "/realvalue", map, this.authorization); + String responseStr = HttpUtils.sendGet(this.url + "/realvalue", map, this.authorization); JSONObject responseObj = JSON.parseObject(responseStr); if (S_CODE != Integer.parseInt(responseObj.get(R_CODE).toString())) { return null; @@ -159,7 +159,7 @@ objs.add(dto); }); queryDto.setObjs(objs); - String responseStr = HttpRequest.sendPost(this.url + "/batchrealvalue", JSONObject.toJSONString(queryDto), this.authorization); + String responseStr = HttpUtils.sendPost(this.url + "/batchrealvalue", JSONObject.toJSONString(queryDto), this.authorization); JSONObject responseObj = JSON.parseObject(responseStr); if (S_CODE != Integer.parseInt(responseObj.get(R_CODE).toString())) { return null; @@ -184,7 +184,7 @@ objs.add(writeDTO); writeObj.setObjs(objs); String writeStr = JSONObject.toJSONString(writeObj); - String responseStr = HttpRequest.sendPost(this.url + "/realvariables", writeStr, this.authorization); + String responseStr = HttpUtils.sendPost(this.url + "/realvariables", writeStr, this.authorization); JSONObject responseObj = JSON.parseObject(responseStr); if (S_CODE != Integer.parseInt(responseObj.get(R_CODE).toString())) { throw new Exception(responseObj.getString(R_MSG)); @@ -200,7 +200,7 @@ writeDTO.setV(newValue); objs.add(writeDTO); writeObj.setObjs(objs); - String responseStr = HttpRequest.sendPost(this.url + "/realvariables", JSONObject.toJSONString(writeObj), this.authorization); + String responseStr = HttpUtils.sendPost(this.url + "/realvariables", JSONObject.toJSONString(writeObj), this.authorization); JSONObject responseObj = JSON.parseObject(responseStr); if (S_CODE != Integer.parseInt(responseObj.get(R_CODE).toString())) { throw new Exception(responseObj.getString(R_MSG)); @@ -215,7 +215,7 @@ writeDTO.setV(newValue); objs.add(writeDTO); writeObj.setObjs(objs); - String responseStr = HttpRequest.sendPost(this.url + "/realvariables", JSONObject.toJSONString(writeObj), this.authorization); + String responseStr = HttpUtils.sendPost(this.url + "/realvariables", JSONObject.toJSONString(writeObj), this.authorization); JSONObject responseObj = JSON.parseObject(responseStr); if (S_CODE != Integer.parseInt(responseObj.get(R_CODE).toString())) { throw new Exception(responseObj.getString(R_MSG)); -- Gitblit v1.9.3