From ea1b00ad9ca8ed8646a93c31ac43f3f870d5d026 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 22 Feb 2022 11:51:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20API=20=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/request/datasource/ApiDefinitionRequest.java | 2 +- .../java/io/dataease/provider/datasource/ApiProvider.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/dataease/controller/request/datasource/ApiDefinitionRequest.java b/backend/src/main/java/io/dataease/controller/request/datasource/ApiDefinitionRequest.java index d975d25a41..ad942518db 100644 --- a/backend/src/main/java/io/dataease/controller/request/datasource/ApiDefinitionRequest.java +++ b/backend/src/main/java/io/dataease/controller/request/datasource/ApiDefinitionRequest.java @@ -13,7 +13,7 @@ public class ApiDefinitionRequest { @Data - public class AuthManager{ + public static class AuthManager{ private String password; private String username; private String verification = ""; diff --git a/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java b/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java index 2edeb52c86..fe73989a2e 100644 --- a/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java +++ b/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java @@ -124,7 +124,6 @@ public class ApiProvider extends DatasourceProvider{ String response = ""; HttpClientConfig httpClientConfig = new HttpClientConfig(); ApiDefinitionRequest apiDefinitionRequest = JSONObject.parseObject(apiDefinition.getRequest(), ApiDefinitionRequest.class); - System.out.println(new Gson().toJson(apiDefinitionRequest.getAuthManager())); //headers for (JSONObject header : apiDefinitionRequest.getHeaders()) { if(StringUtils.isNotEmpty(header.getString("name")) && StringUtils.isNotEmpty(header.getString("value"))){ @@ -174,7 +173,6 @@ public class ApiProvider extends DatasourceProvider{ default: break; } - System.out.println("response: " + response); return response; } @@ -187,7 +185,7 @@ public class ApiProvider extends DatasourceProvider{ int i = 0; while (it.hasNext()){ Map.Entry entry = (Map.Entry)it.next(); - row[i] = entry.getValue().toString(); + row[i] = Optional.ofNullable(entry.getValue()).orElse("").toString(); i++; } dataList.add(row);