From 45fcbdfe6028fdc0f51e9b485da900a29876d4c9 Mon Sep 17 00:00:00 2001 From: zoujiangtao Date: Wed, 4 Dec 2024 16:37:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=EF=BC=9A=E9=82=B9?= =?UTF-8?q?=E6=B1=9F=E6=B6=9B=20=E4=BF=AE=E6=94=B9=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=9AAPI=E6=98=A0=E5=B0=84=E5=85=AC=E5=85=B1=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=20=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=EF=BC=9A2024/1?= =?UTF-8?q?2/04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/shkd/sys/sys/common/ApiEntity.java | 11 +++++++++++ .../sys/sys/plugin/form/ApiMappingBillPlugin.java | 3 +++ 2 files changed, 14 insertions(+) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/common/ApiEntity.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/common/ApiEntity.java index aef4957..658bbc7 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/common/ApiEntity.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/common/ApiEntity.java @@ -70,6 +70,17 @@ public class ApiEntity { this.requestBody = requestBody; } + @Override + public String toString() { + return "ApiEntity{" + + "URL='" + URL + '\'' + + ", method='" + method + '\'' + + ", queryParams=" + queryParams + + ", headers=" + headers + + ", requestBody=" + requestBody + + '}'; + } + public ApiEntity() { } diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java index 2b6737c..648c97c 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiMappingBillPlugin.java @@ -230,6 +230,7 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin { if ("shkd_testapi".equals(itemKey)) { //域名 String domainName = dataEntity.getString("shkd_domainname"); + //url String url = dataEntity.getString("shkd_url"); ApiEntity apiEntity = new ApiEntity(); apiEntity.setURL(domainName + url); @@ -239,10 +240,12 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin { apiEntity.setHeaders(headMap); Map paramsMap = new HashMap<>(); Map resultMap = ApiService.getBIPToken(domainName); + logger.info("getBIPToken → 获取返回token:{}", resultMap.get("token")); paramsMap.put("access_token", resultMap.get("token")); apiEntity.setQueryParams(paramsMap); apiEntity.setRequestBody(codeEdit.getText()); JSONObject responseBody = ApiEntity.getResponseBody(apiEntity); + logger.info("调用接口实体对象apiEntity → 返回结果:{}", apiEntity); this.getView().showTipNotification("返回结果:" + responseBody.toJSONString()); } }