From 66183622ffaa9e93bac9aa3da61cfc6fb09a721b Mon Sep 17 00:00:00 2001 From: ulleo Date: Fri, 23 Aug 2024 18:11:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=20X-Pack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasource/server/DatasourceServer.java | 16 +++++++++++++--- de-xpack | 2 +- .../java/io/dataease/api/ds/DatasourceApi.java | 7 +++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index 0b4d40699b..51ffb3856e 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -70,7 +70,6 @@ import java.util.stream.Collectors; import static io.dataease.datasource.server.DatasourceTaskServer.ScheduleType.MANUAL; import static io.dataease.datasource.server.DatasourceTaskServer.ScheduleType.RIGHTNOW; -import static io.dataease.result.ResultCode.DS_RESOURCE_UNCHECKED; @RestController @@ -530,7 +529,7 @@ public class DatasourceServer implements DatasourceApi { } @Override - public List innerList(List ids) throws DEException { + public List innerList(List ids, List types) throws DEException { List list = new ArrayList<>(); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); if (ids != null) { @@ -540,9 +539,20 @@ public class DatasourceServer implements DatasourceApi { queryWrapper.in(CoreDatasource::getId, ids); } } + if (types != null) { + if (types.isEmpty()) { + return list; + } else { + queryWrapper.in(CoreDatasource::getType, types); + } + } List dsList = datasourceMapper.selectList(queryWrapper); for (CoreDatasource datasource : dsList) { - list.add(convertCoreDatasource(datasource.getId(), false, datasource)); + try { + list.add(convertCoreDatasource(datasource.getId(), false, datasource)); + } catch (Exception e) { + e.printStackTrace(); + } } return list; } diff --git a/de-xpack b/de-xpack index ecc332d1ab..9a7b3488f9 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit ecc332d1abc22b822956380277990708ef8457b3 +Subproject commit 9a7b3488f9e8dee6ea156cbdf34f789dda011f7d diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/ds/DatasourceApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/ds/DatasourceApi.java index b7d5d3a88d..8b1b7d3717 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/ds/DatasourceApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/ds/DatasourceApi.java @@ -2,7 +2,9 @@ package io.dataease.api.ds; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiSupport; -import io.dataease.api.ds.vo.*; +import io.dataease.api.ds.vo.ApiDefinition; +import io.dataease.api.ds.vo.CoreDatasourceTaskLogDTO; +import io.dataease.api.ds.vo.ExcelFileData; import io.dataease.auth.DeApiPath; import io.dataease.auth.DePermit; import io.dataease.exception.DEException; @@ -79,7 +81,8 @@ public interface DatasourceApi { DatasourceDTO get(@PathVariable("datasourceId") Long datasourceId) throws DEException; DatasourceDTO innerGet(Long datasourceId) throws DEException; - List innerList(List ids) throws DEException; + + List innerList(List ids, List types) throws DEException; @DePermit({"#p0+':read'"}) @GetMapping("/hidePw/{datasourceId}")