Skip to content

Commit b15f1ac

Browse files
committed
Add Support Type Query
1 parent 2a0def8 commit b15f1ac

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/data/source/DataSourceController.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
@Slf4j
6464
public class DataSourceController {
6565

66+
private static final DataSourceSelector DATA_SOURCE_SELECTOR= DataSourceSelector.builder()
67+
.environment(Boolean.TRUE)
68+
.build();
69+
6670
@Autowired
6771
private DataSourceService dataSourceService;
6872

@@ -166,7 +170,7 @@ public ActionResult closeConsole(@Valid @NotNull ConsoleCloseRequest request) {
166170
@GetMapping("/datasource/list")
167171
public WebPageResult<DataSourceVO> list(DataSourceQueryRequest request) {
168172
DataSourcePageQueryParam param = dataSourceWebConverter.queryReq2param(request);
169-
PageResult<DataSource> result = dataSourceService.queryPage(param, new DataSourceSelector());
173+
PageResult<DataSource> result = dataSourceService.queryPageWithPermission(param, DATA_SOURCE_SELECTOR);
170174
List<DataSourceVO> dataSourceVOS = dataSourceWebConverter.dto2vo(result.getData());
171175
return WebPageResult.of(dataSourceVOS, result.getTotal(), result.getPageNo(), result.getPageSize());
172176
}

chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/data/source/vo/DataSourceVO.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.List;
44

5+
import ai.chat2db.server.common.api.controller.vo.SimpleEnvironmentVO;
56
import ai.chat2db.spi.config.DriverConfig;
67
import ai.chat2db.spi.model.KeyValue;
78
import ai.chat2db.spi.model.SSHInfo;
@@ -99,4 +100,9 @@ public class DataSourceVO {
99100
* 驱动配置
100101
*/
101102
private DriverConfig driverConfig;
103+
104+
/**
105+
* 环境
106+
*/
107+
private SimpleEnvironmentVO environment;
102108
}

0 commit comments

Comments
 (0)