From a6ca97f67038e23428acd9cf42ad2de11f793d32 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 5 Jun 2024 15:06:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasource/provider/CalciteProvider.java | 64 +++++++++++++++++++ .../main/resources/db/desktop/V2.7__ddl.sql | 30 ++++----- 2 files changed, 79 insertions(+), 15 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/provider/CalciteProvider.java b/core/core-backend/src/main/java/io/dataease/datasource/provider/CalciteProvider.java index 75bb0b0f63..947ec1c0cd 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/provider/CalciteProvider.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/provider/CalciteProvider.java @@ -341,6 +341,70 @@ public class CalciteProvider { } } break; + case pg: + configuration = JsonUtil.parseObject(datasourceDTO.getConfiguration(), Pg.class); + if (StringUtils.isNotEmpty(configuration.getUrlType()) && configuration.getUrlType().equalsIgnoreCase("jdbcUrl")) { + if (configuration.getJdbcUrl().contains("password=")) { + String[] params = configuration.getJdbcUrl().split("\\?")[1].split("&"); + String pd = ""; + for (int i = 0; i < params.length; i++) { + if (params[i].contains("password=")) { + pd = params[i]; + } + } + configuration.setJdbcUrl(configuration.getJdbcUrl().replace(pd, "password=******")); + datasourceDTO.setConfiguration(JsonUtil.toJSONString(configuration).toString()); + } + } + break; + case redshift: + configuration = JsonUtil.parseObject(datasourceDTO.getConfiguration(), Redshift.class); + if (StringUtils.isNotEmpty(configuration.getUrlType()) && configuration.getUrlType().equalsIgnoreCase("jdbcUrl")) { + if (configuration.getJdbcUrl().contains("password=")) { + String[] params = configuration.getJdbcUrl().split("\\?")[1].split("&"); + String pd = ""; + for (int i = 0; i < params.length; i++) { + if (params[i].contains("password=")) { + pd = params[i]; + } + } + configuration.setJdbcUrl(configuration.getJdbcUrl().replace(pd, "password=******")); + datasourceDTO.setConfiguration(JsonUtil.toJSONString(configuration).toString()); + } + } + break; + case ck: + configuration = JsonUtil.parseObject(datasourceDTO.getConfiguration(), CK.class); + if (StringUtils.isNotEmpty(configuration.getUrlType()) && configuration.getUrlType().equalsIgnoreCase("jdbcUrl")) { + if (configuration.getJdbcUrl().contains("password=")) { + String[] params = configuration.getJdbcUrl().split("\\?")[1].split("&"); + String pd = ""; + for (int i = 0; i < params.length; i++) { + if (params[i].contains("password=")) { + pd = params[i]; + } + } + configuration.setJdbcUrl(configuration.getJdbcUrl().replace(pd, "password=******")); + datasourceDTO.setConfiguration(JsonUtil.toJSONString(configuration).toString()); + } + } + break; + case impala: + configuration = JsonUtil.parseObject(datasourceDTO.getConfiguration(), Impala.class); + if (StringUtils.isNotEmpty(configuration.getUrlType()) && configuration.getUrlType().equalsIgnoreCase("jdbcUrl")) { + if (configuration.getJdbcUrl().contains("password=")) { + String[] params = configuration.getJdbcUrl().split(";")[1].split("&"); + String pd = ""; + for (int i = 0; i < params.length; i++) { + if (params[i].contains("password=")) { + pd = params[i]; + } + } + configuration.setJdbcUrl(configuration.getJdbcUrl().replace(pd, "password=******")); + datasourceDTO.setConfiguration(JsonUtil.toJSONString(configuration).toString()); + } + } + break; default: break; } diff --git a/core/core-backend/src/main/resources/db/desktop/V2.7__ddl.sql b/core/core-backend/src/main/resources/db/desktop/V2.7__ddl.sql index a792416b03..6de7b516c6 100644 --- a/core/core-backend/src/main/resources/db/desktop/V2.7__ddl.sql +++ b/core/core-backend/src/main/resources/db/desktop/V2.7__ddl.sql @@ -15,22 +15,22 @@ INSERT INTO `core_sys_startup_job` VALUES ('chartFilterMerge', 'chartFilterMerge COMMIT; -DROP TABLE IF EXISTS "core_export_task"; -CREATE TABLE "core_export_task" +DROP TABLE IF EXISTS `core_export_task`; +CREATE TABLE `core_export_task` ( - "id" VARCHAR(255) NOT NULL, - "user_id" BIGINT(20) NOT NULL, - "file_name" VARCHAR(2048) DEFAULT NULL, - "file_size" DOUBLE DEFAULT NULL, - "file_size_unit" VARCHAR(255) DEFAULT NULL, - "export_from" VARCHAR(255) DEFAULT NULL, - "export_status" VARCHAR(255) DEFAULT NULL, - "export_from_type" VARCHAR(255) DEFAULT NULL, - "export_time" BIGINT(20) DEFAULT NULL, - "export_progress" VARCHAR(255) DEFAULT NULL, - "export_machine_name" VARCHAR(512) DEFAULT NULL, - "params" CLOB NOT NULL COMMENT '过滤参数', - PRIMARY KEY ("id") + `id` VARCHAR(255) NOT NULL, + `user_id` BIGINT(20) NOT NULL, + `file_name` VARCHAR(2048) DEFAULT NULL, + `file_size` DOUBLE DEFAULT NULL, + `file_size_unit` VARCHAR(255) DEFAULT NULL, + `export_from` VARCHAR(255) DEFAULT NULL, + `export_status` VARCHAR(255) DEFAULT NULL, + `export_from_type` VARCHAR(255) DEFAULT NULL, + `export_time` BIGINT(20) DEFAULT NULL, + `export_progress` VARCHAR(255) DEFAULT NULL, + `export_machine_name` VARCHAR(512) DEFAULT NULL, + `params` longtext NOT NULL COMMENT '过滤参数', + PRIMARY KEY (`id`) ) COMMENT='导出任务表'; UPDATE `QRTZ_JOB_DETAILS` SET `JOB_CLASS_NAME` = 'io.dataease.job.schedule.CheckDsStatusJob' WHERE (`SCHED_NAME` = 'deSyncJob') and (`JOB_NAME` = 'Datasource') and (`JOB_GROUP` = 'check_status');