forked from github/dataease
commit
5375f640d9
core
core-backend/src/main/java/io/dataease/datasource/server
core-frontend/src/views/visualized/data/dataset
sdk/api/api-base/src/main/java/io/dataease/api/ds
@ -9,10 +9,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.dataease.api.dataset.dto.PreviewSqlDTO;
|
import io.dataease.api.dataset.dto.PreviewSqlDTO;
|
||||||
import io.dataease.api.ds.DatasourceApi;
|
import io.dataease.api.ds.DatasourceApi;
|
||||||
import io.dataease.api.ds.vo.ApiDefinition;
|
import io.dataease.api.ds.vo.*;
|
||||||
import io.dataease.api.ds.vo.CoreDatasourceTaskLogDTO;
|
|
||||||
import io.dataease.api.ds.vo.ExcelFileData;
|
|
||||||
import io.dataease.api.ds.vo.ExcelSheetData;
|
|
||||||
import io.dataease.api.permissions.relation.api.RelationApi;
|
import io.dataease.api.permissions.relation.api.RelationApi;
|
||||||
import io.dataease.commons.constants.TaskStatus;
|
import io.dataease.commons.constants.TaskStatus;
|
||||||
import io.dataease.constant.LogOT;
|
import io.dataease.constant.LogOT;
|
||||||
@ -92,7 +89,6 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
@Resource
|
@Resource
|
||||||
private TaskLogExtMapper taskLogExtMapper;
|
private TaskLogExtMapper taskLogExtMapper;
|
||||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DataSourceManage dataSourceManage;
|
private DataSourceManage dataSourceManage;
|
||||||
@Resource
|
@Resource
|
||||||
@ -103,61 +99,32 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
private CoreDsFinishPageMapper coreDsFinishPageMapper;
|
private CoreDsFinishPageMapper coreDsFinishPageMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private DatasetDataManage datasetDataManage;
|
private DatasetDataManage datasetDataManage;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ScheduleManager scheduleManager;
|
private ScheduleManager scheduleManager;
|
||||||
@Resource
|
@Resource
|
||||||
private CoreUserManage coreUserManage;
|
private CoreUserManage coreUserManage;
|
||||||
|
|
||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
private PluginManageApi pluginManage;
|
private PluginManageApi pluginManage;
|
||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
private RelationApi relationManage;
|
private RelationApi relationManage;
|
||||||
|
|
||||||
|
public enum UpdateType {
|
||||||
|
all_scope, add_scope
|
||||||
|
}
|
||||||
|
private TypeReference<List<ApiDefinition>> listTypeReference = new TypeReference<List<ApiDefinition>>() {
|
||||||
|
};
|
||||||
|
@Resource
|
||||||
|
private CommonThreadPool commonThreadPool;
|
||||||
|
private boolean isUpdatingStatus = false;
|
||||||
|
private static List<Long> syncDsIds = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DatasourceDTO> query(String keyWord) {
|
public List<DatasourceDTO> query(String keyWord) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum UpdateType {
|
public boolean checkRepeat(@RequestBody BusiDsRequest dataSourceDTO) {
|
||||||
all_scope, add_scope
|
|
||||||
}
|
|
||||||
|
|
||||||
private TypeReference<List<ApiDefinition>> listTypeReference = new TypeReference<List<ApiDefinition>>() {
|
|
||||||
};
|
|
||||||
@Resource
|
|
||||||
private CommonThreadPool commonThreadPool;
|
|
||||||
|
|
||||||
private boolean isUpdatingStatus = false;
|
|
||||||
|
|
||||||
private static List<Long> syncDsIds = new ArrayList<>();
|
|
||||||
|
|
||||||
private void getParents(Long pid, List<Long> ids) {
|
|
||||||
CoreDatasource parent = datasourceMapper.selectById(pid);// 查找父级folder
|
|
||||||
ids.add(parent.getId());
|
|
||||||
if (parent.getPid() != null && parent.getPid() != 0) {
|
|
||||||
getParents(parent.getPid(), ids);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void filterDs(List<BusiNodeVO> busiNodeVOS, List<Long> ids, String type, Long id) {
|
|
||||||
for (BusiNodeVO busiNodeVO : busiNodeVOS) {
|
|
||||||
if (busiNodeVO.getType() != null && busiNodeVO.getType().equalsIgnoreCase(type)) {
|
|
||||||
if (id != null) {
|
|
||||||
if (!busiNodeVO.getId().equals(id)) {
|
|
||||||
ids.add(busiNodeVO.getId());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ids.add(busiNodeVO.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (CollectionUtils.isNotEmpty(busiNodeVO.getChildren())) {
|
|
||||||
filterDs(busiNodeVO.getChildren(), ids, type, id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean checkRepeat(@RequestBody DatasourceDTO dataSourceDTO) {
|
|
||||||
if (Arrays.asList("API", "Excel", "folder").contains(dataSourceDTO.getType())) {
|
if (Arrays.asList("API", "Excel", "folder").contains(dataSourceDTO.getType())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -211,7 +178,9 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
|
|
||||||
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE)
|
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE)
|
||||||
@Transactional
|
@Transactional
|
||||||
public DatasourceDTO move(DatasourceDTO dataSourceDTO) {
|
public DatasourceDTO move(BusiDsRequest busiDsRequest) {
|
||||||
|
DatasourceDTO dataSourceDTO = new DatasourceDTO();
|
||||||
|
BeanUtils.copyBean(dataSourceDTO, busiDsRequest);
|
||||||
if (dataSourceDTO.getPid() == null) {
|
if (dataSourceDTO.getPid() == null) {
|
||||||
DEException.throwException("目录必选!");
|
DEException.throwException("目录必选!");
|
||||||
}
|
}
|
||||||
@ -230,7 +199,9 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public DatasourceDTO reName(DatasourceDTO dataSourceDTO) {
|
public DatasourceDTO reName(BusiDsRequest busiDsRequest) {
|
||||||
|
DatasourceDTO dataSourceDTO = new DatasourceDTO();
|
||||||
|
BeanUtils.copyBean(dataSourceDTO, busiDsRequest);
|
||||||
if (StringUtils.isEmpty(dataSourceDTO.getName())) {
|
if (StringUtils.isEmpty(dataSourceDTO.getName())) {
|
||||||
DEException.throwException("名称不能为空!");
|
DEException.throwException("名称不能为空!");
|
||||||
}
|
}
|
||||||
@ -243,7 +214,9 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
|
|
||||||
@DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, st = LogST.DATASOURCE)
|
@DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, st = LogST.DATASOURCE)
|
||||||
@Transactional
|
@Transactional
|
||||||
public DatasourceDTO createFolder(DatasourceDTO dataSourceDTO) {
|
public DatasourceDTO createFolder(BusiDsRequest busiDsRequest) {
|
||||||
|
DatasourceDTO dataSourceDTO = new DatasourceDTO();
|
||||||
|
BeanUtils.copyBean(dataSourceDTO, busiDsRequest);
|
||||||
dataSourceDTO.setCreateTime(System.currentTimeMillis());
|
dataSourceDTO.setCreateTime(System.currentTimeMillis());
|
||||||
dataSourceDTO.setUpdateTime(System.currentTimeMillis());
|
dataSourceDTO.setUpdateTime(System.currentTimeMillis());
|
||||||
dataSourceDTO.setType(dataSourceDTO.getNodeType());
|
dataSourceDTO.setType(dataSourceDTO.getNodeType());
|
||||||
@ -256,9 +229,11 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
@DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, st = LogST.DATASOURCE)
|
@DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, st = LogST.DATASOURCE)
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public DatasourceDTO save(DatasourceDTO dataSourceDTO) throws DEException {
|
public DatasourceDTO save(BusiDsRequest busiDsRequest) throws DEException {
|
||||||
|
DatasourceDTO dataSourceDTO = new DatasourceDTO();
|
||||||
|
BeanUtils.copyBean(dataSourceDTO, busiDsRequest);
|
||||||
if (dataSourceDTO.getId() != null && dataSourceDTO.getId() > 0) {
|
if (dataSourceDTO.getId() != null && dataSourceDTO.getId() > 0) {
|
||||||
return update(dataSourceDTO);
|
return update(busiDsRequest);
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(dataSourceDTO.getConfiguration())) {
|
if (StringUtils.isNotEmpty(dataSourceDTO.getConfiguration())) {
|
||||||
dataSourceDTO.setConfiguration(new String(Base64.getDecoder().decode(dataSourceDTO.getConfiguration())));
|
dataSourceDTO.setConfiguration(new String(Base64.getDecoder().decode(dataSourceDTO.getConfiguration())));
|
||||||
@ -337,10 +312,12 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE)
|
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE)
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public DatasourceDTO update(DatasourceDTO dataSourceDTO) throws DEException {
|
public DatasourceDTO update(BusiDsRequest busiDsRequest) throws DEException {
|
||||||
|
DatasourceDTO dataSourceDTO = new DatasourceDTO();
|
||||||
|
BeanUtils.copyBean(dataSourceDTO, busiDsRequest);
|
||||||
Long pk = null;
|
Long pk = null;
|
||||||
if (ObjectUtils.isEmpty(pk = dataSourceDTO.getId())) {
|
if (ObjectUtils.isEmpty(pk = dataSourceDTO.getId())) {
|
||||||
return save(dataSourceDTO);
|
return save(busiDsRequest);
|
||||||
}
|
}
|
||||||
DatasourceDTO sourceData = dataSourceManage.getDs(pk);
|
DatasourceDTO sourceData = dataSourceManage.getDs(pk);
|
||||||
dataSourceDTO.setConfiguration(new String(Base64.getDecoder().decode(dataSourceDTO.getConfiguration())));
|
dataSourceDTO.setConfiguration(new String(Base64.getDecoder().decode(dataSourceDTO.getConfiguration())));
|
||||||
@ -461,35 +438,6 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
return dataSourceDTO;
|
return dataSourceDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void checkParams(String configurationStr) {
|
|
||||||
DatasourceConfiguration configuration = JsonUtil.parseObject(configurationStr, DatasourceConfiguration.class);
|
|
||||||
if (configuration.getInitialPoolSize() < configuration.getMinPoolSize()) {
|
|
||||||
DEException.throwException("初始连接数不能小于最小连接数!");
|
|
||||||
}
|
|
||||||
if (configuration.getInitialPoolSize() > configuration.getMaxPoolSize()) {
|
|
||||||
DEException.throwException("初始连接数不能大于最大连接数!");
|
|
||||||
}
|
|
||||||
if (configuration.getMaxPoolSize() < configuration.getMinPoolSize()) {
|
|
||||||
DEException.throwException("最大连接数不能小于最小连接数!");
|
|
||||||
}
|
|
||||||
if (configuration.getQueryTimeout() < 0) {
|
|
||||||
DEException.throwException("查询超时不能小于0!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void checkName(List<String> tables) {
|
|
||||||
for (int i = 0; i < tables.size() - 1; i++) {
|
|
||||||
for (int j = i + 1; j < tables.size(); j++) {
|
|
||||||
if (tables.get(i).equalsIgnoreCase(tables.get(j))) {
|
|
||||||
DEException.throwException(Translator.get("i18n_table_name_repeat") + tables.get(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String excelDataTableName(String name) {
|
|
||||||
return StringUtils.substring(name, 6, name.length() - 11);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DatasourceConfiguration.DatasourceType> datasourceTypes() {
|
public List<DatasourceConfiguration.DatasourceType> datasourceTypes() {
|
||||||
@ -497,7 +445,9 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasourceDTO validate(DatasourceDTO dataSourceDTO) throws DEException {
|
public DatasourceDTO validate(BusiDsRequest busiDsRequest) throws DEException {
|
||||||
|
DatasourceDTO dataSourceDTO = new DatasourceDTO();
|
||||||
|
BeanUtils.copyBean(dataSourceDTO, busiDsRequest);
|
||||||
dataSourceDTO.setConfiguration(new String(Base64.getDecoder().decode(dataSourceDTO.getConfiguration())));
|
dataSourceDTO.setConfiguration(new String(Base64.getDecoder().decode(dataSourceDTO.getConfiguration())));
|
||||||
CoreDatasource coreDatasource = new CoreDatasource();
|
CoreDatasource coreDatasource = new CoreDatasource();
|
||||||
BeanUtils.copyBean(coreDatasource, dataSourceDTO);
|
BeanUtils.copyBean(coreDatasource, dataSourceDTO);
|
||||||
@ -509,7 +459,7 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getSchema(DatasourceDTO dataSourceDTO) throws DEException {
|
public List<String> getSchema(BusiDsRequest dataSourceDTO) throws DEException {
|
||||||
dataSourceDTO.setConfiguration(new String(Base64.getDecoder().decode(dataSourceDTO.getConfiguration())));
|
dataSourceDTO.setConfiguration(new String(Base64.getDecoder().decode(dataSourceDTO.getConfiguration())));
|
||||||
CoreDatasource coreDatasource = new CoreDatasource();
|
CoreDatasource coreDatasource = new CoreDatasource();
|
||||||
BeanUtils.copyBean(coreDatasource, dataSourceDTO);
|
BeanUtils.copyBean(coreDatasource, dataSourceDTO);
|
||||||
@ -563,90 +513,6 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DatasourceDTO getDatasourceDTOById(Long datasourceId, boolean hidePw) throws DEException {
|
|
||||||
CoreDatasource datasource = datasourceMapper.selectById(datasourceId);
|
|
||||||
if (datasource == null) {
|
|
||||||
DEException.throwException("不存在的数据源!");
|
|
||||||
}
|
|
||||||
return convertCoreDatasource(datasourceId, hidePw, datasource);
|
|
||||||
}
|
|
||||||
|
|
||||||
private DatasourceDTO convertCoreDatasource(Long datasourceId, boolean hidePw, CoreDatasource datasource) {
|
|
||||||
DatasourceDTO datasourceDTO = new DatasourceDTO();
|
|
||||||
BeanUtils.copyBean(datasourceDTO, datasource);
|
|
||||||
|
|
||||||
if (datasourceDTO.getType().equalsIgnoreCase(DatasourceConfiguration.DatasourceType.API.toString())) {
|
|
||||||
List<ApiDefinition> apiDefinitionList = JsonUtil.parseList(datasourceDTO.getConfiguration(), listTypeReference);
|
|
||||||
List<ApiDefinition> apiDefinitionListWithStatus = new ArrayList<>();
|
|
||||||
List<ApiDefinition> params = new ArrayList<>();
|
|
||||||
int success = 0;
|
|
||||||
for (ApiDefinition apiDefinition : apiDefinitionList) {
|
|
||||||
String status = null;
|
|
||||||
if (StringUtils.isNotEmpty(datasourceDTO.getStatus())) {
|
|
||||||
JsonNode jsonNode = null;
|
|
||||||
try {
|
|
||||||
jsonNode = objectMapper.readTree(datasourceDTO.getStatus());
|
|
||||||
} catch (Exception e) {
|
|
||||||
DEException.throwException(e);
|
|
||||||
}
|
|
||||||
for (JsonNode node : jsonNode) {
|
|
||||||
if (node.get("name").asText().equals(apiDefinition.getName())) {
|
|
||||||
status = node.get("status").asText();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
apiDefinition.setStatus(status);
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(status) && status.equalsIgnoreCase("Success")) {
|
|
||||||
success++;
|
|
||||||
}
|
|
||||||
CoreDatasourceTaskLog log = datasourceTaskServer.lastSyncLogForTable(datasourceId, apiDefinition.getDeTableName());
|
|
||||||
if (log != null) {
|
|
||||||
apiDefinition.setUpdateTime(log.getStartTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (StringUtils.isEmpty(apiDefinition.getType()) || apiDefinition.getType().equalsIgnoreCase("table")) {
|
|
||||||
apiDefinitionListWithStatus.add(apiDefinition);
|
|
||||||
} else {
|
|
||||||
params.add(apiDefinition);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
datasourceDTO.setApiConfigurationStr(new String(Base64.getEncoder().encode(Objects.requireNonNull(JsonUtil.toJSONString(apiDefinitionListWithStatus)).toString().getBytes())));
|
|
||||||
datasourceDTO.setParamsStr(new String(Base64.getEncoder().encode(Objects.requireNonNull(JsonUtil.toJSONString(params)).toString().getBytes())));
|
|
||||||
if (success == apiDefinitionList.size()) {
|
|
||||||
datasourceDTO.setStatus("Success");
|
|
||||||
} else {
|
|
||||||
if (success > 0 && success < apiDefinitionList.size()) {
|
|
||||||
datasourceDTO.setStatus("Warning");
|
|
||||||
} else {
|
|
||||||
datasourceDTO.setStatus("Error");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CoreDatasourceTask coreDatasourceTask = datasourceTaskServer.selectByDSId(datasourceDTO.getId());
|
|
||||||
TaskDTO taskDTO = new TaskDTO();
|
|
||||||
BeanUtils.copyBean(taskDTO, coreDatasourceTask);
|
|
||||||
datasourceDTO.setSyncSetting(taskDTO);
|
|
||||||
|
|
||||||
CoreDatasourceTask task = datasourceTaskServer.selectByDSId(datasourceDTO.getId());
|
|
||||||
if (task != null) {
|
|
||||||
datasourceDTO.setLastSyncTime(task.getStartTime());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (hidePw) {
|
|
||||||
Provider provider = ProviderFactory.getProvider(datasourceDTO.getType());
|
|
||||||
provider.hidePW(datasourceDTO);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (datasourceDTO.getType().equalsIgnoreCase(DatasourceConfiguration.DatasourceType.Excel.toString())) {
|
|
||||||
datasourceDTO.setFileName(ExcelUtils.getFileName(datasource));
|
|
||||||
datasourceDTO.setSize(ExcelUtils.getSize(datasource));
|
|
||||||
}
|
|
||||||
datasourceDTO.setConfiguration(new String(Base64.getEncoder().encode(datasourceDTO.getConfiguration().getBytes())));
|
|
||||||
datasourceDTO.setCreator(coreUserManage.getUserName(Long.valueOf(datasourceDTO.getCreateBy())));
|
|
||||||
return datasourceDTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean perDelete(Long id) {
|
public boolean perDelete(Long id) {
|
||||||
if (LicenseUtil.licenseValid()) {
|
if (LicenseUtil.licenseValid()) {
|
||||||
@ -758,25 +624,6 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
cron, new Date(System.currentTimeMillis()), null, new JobDataMap());
|
cron, new Date(System.currentTimeMillis()), null, new JobDataMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
private DatasourceDTO validate(CoreDatasource coreDatasource) {
|
|
||||||
DatasourceDTO datasourceDTO = new DatasourceDTO();
|
|
||||||
BeanUtils.copyBean(datasourceDTO, coreDatasource);
|
|
||||||
try {
|
|
||||||
checkDatasourceStatus(datasourceDTO);
|
|
||||||
if (!Arrays.asList("API", "Excel", "folder").contains(coreDatasource.getType())) {
|
|
||||||
calciteProvider.updateDsPoolAfterCheckStatus(datasourceDTO);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
coreDatasource.setStatus("Error");
|
|
||||||
DEException.throwException(e.getMessage());
|
|
||||||
} finally {
|
|
||||||
coreDatasource.setStatus(datasourceDTO.getStatus());
|
|
||||||
dataSourceManage.innerEditStatus(coreDatasource);
|
|
||||||
}
|
|
||||||
datasourceDTO.setConfiguration("");
|
|
||||||
return datasourceDTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BusiNodeVO> tree(BusiNodeRequest request) throws DEException {
|
public List<BusiNodeVO> tree(BusiNodeRequest request) throws DEException {
|
||||||
return dataSourceManage.tree(request);
|
return dataSourceManage.tree(request);
|
||||||
@ -1044,8 +891,6 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IPage<CoreDatasourceTaskLogDTO> listSyncRecord(int goPage, int pageSize, Long dsId) {
|
public IPage<CoreDatasourceTaskLogDTO> listSyncRecord(int goPage, int pageSize, Long dsId) {
|
||||||
|
|
||||||
|
|
||||||
QueryWrapper<CoreDatasourceTaskLogDTO> wrapper = new QueryWrapper<>();
|
QueryWrapper<CoreDatasourceTaskLogDTO> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq("ds_id", dsId);
|
wrapper.eq("ds_id", dsId);
|
||||||
wrapper.orderByDesc("start_time");
|
wrapper.orderByDesc("start_time");
|
||||||
@ -1149,4 +994,163 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
BeanUtils.copyBean(datasourceDTO, record);
|
BeanUtils.copyBean(datasourceDTO, record);
|
||||||
return datasourceDTO;
|
return datasourceDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void getParents(Long pid, List<Long> ids) {
|
||||||
|
CoreDatasource parent = datasourceMapper.selectById(pid);// 查找父级folder
|
||||||
|
ids.add(parent.getId());
|
||||||
|
if (parent.getPid() != null && parent.getPid() != 0) {
|
||||||
|
getParents(parent.getPid(), ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void filterDs(List<BusiNodeVO> busiNodeVOS, List<Long> ids, String type, Long id) {
|
||||||
|
for (BusiNodeVO busiNodeVO : busiNodeVOS) {
|
||||||
|
if (busiNodeVO.getType() != null && busiNodeVO.getType().equalsIgnoreCase(type)) {
|
||||||
|
if (id != null) {
|
||||||
|
if (!busiNodeVO.getId().equals(id)) {
|
||||||
|
ids.add(busiNodeVO.getId());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ids.add(busiNodeVO.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(busiNodeVO.getChildren())) {
|
||||||
|
filterDs(busiNodeVO.getChildren(), ids, type, id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void checkParams(String configurationStr) {
|
||||||
|
DatasourceConfiguration configuration = JsonUtil.parseObject(configurationStr, DatasourceConfiguration.class);
|
||||||
|
if (configuration.getInitialPoolSize() < configuration.getMinPoolSize()) {
|
||||||
|
DEException.throwException("初始连接数不能小于最小连接数!");
|
||||||
|
}
|
||||||
|
if (configuration.getInitialPoolSize() > configuration.getMaxPoolSize()) {
|
||||||
|
DEException.throwException("初始连接数不能大于最大连接数!");
|
||||||
|
}
|
||||||
|
if (configuration.getMaxPoolSize() < configuration.getMinPoolSize()) {
|
||||||
|
DEException.throwException("最大连接数不能小于最小连接数!");
|
||||||
|
}
|
||||||
|
if (configuration.getQueryTimeout() < 0) {
|
||||||
|
DEException.throwException("查询超时不能小于0!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void checkName(List<String> tables) {
|
||||||
|
for (int i = 0; i < tables.size() - 1; i++) {
|
||||||
|
for (int j = i + 1; j < tables.size(); j++) {
|
||||||
|
if (tables.get(i).equalsIgnoreCase(tables.get(j))) {
|
||||||
|
DEException.throwException(Translator.get("i18n_table_name_repeat") + tables.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String excelDataTableName(String name) {
|
||||||
|
return StringUtils.substring(name, 6, name.length() - 11);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DatasourceDTO getDatasourceDTOById(Long datasourceId, boolean hidePw) throws DEException {
|
||||||
|
CoreDatasource datasource = datasourceMapper.selectById(datasourceId);
|
||||||
|
if (datasource == null) {
|
||||||
|
DEException.throwException("不存在的数据源!");
|
||||||
|
}
|
||||||
|
return convertCoreDatasource(datasourceId, hidePw, datasource);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DatasourceDTO convertCoreDatasource(Long datasourceId, boolean hidePw, CoreDatasource datasource) {
|
||||||
|
DatasourceDTO datasourceDTO = new DatasourceDTO();
|
||||||
|
BeanUtils.copyBean(datasourceDTO, datasource);
|
||||||
|
|
||||||
|
if (datasourceDTO.getType().equalsIgnoreCase(DatasourceConfiguration.DatasourceType.API.toString())) {
|
||||||
|
List<ApiDefinition> apiDefinitionList = JsonUtil.parseList(datasourceDTO.getConfiguration(), listTypeReference);
|
||||||
|
List<ApiDefinition> apiDefinitionListWithStatus = new ArrayList<>();
|
||||||
|
List<ApiDefinition> params = new ArrayList<>();
|
||||||
|
int success = 0;
|
||||||
|
for (ApiDefinition apiDefinition : apiDefinitionList) {
|
||||||
|
String status = null;
|
||||||
|
if (StringUtils.isNotEmpty(datasourceDTO.getStatus())) {
|
||||||
|
JsonNode jsonNode = null;
|
||||||
|
try {
|
||||||
|
jsonNode = objectMapper.readTree(datasourceDTO.getStatus());
|
||||||
|
} catch (Exception e) {
|
||||||
|
DEException.throwException(e);
|
||||||
|
}
|
||||||
|
for (JsonNode node : jsonNode) {
|
||||||
|
if (node.get("name").asText().equals(apiDefinition.getName())) {
|
||||||
|
status = node.get("status").asText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
apiDefinition.setStatus(status);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(status) && status.equalsIgnoreCase("Success")) {
|
||||||
|
success++;
|
||||||
|
}
|
||||||
|
CoreDatasourceTaskLog log = datasourceTaskServer.lastSyncLogForTable(datasourceId, apiDefinition.getDeTableName());
|
||||||
|
if (log != null) {
|
||||||
|
apiDefinition.setUpdateTime(log.getStartTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(apiDefinition.getType()) || apiDefinition.getType().equalsIgnoreCase("table")) {
|
||||||
|
apiDefinitionListWithStatus.add(apiDefinition);
|
||||||
|
} else {
|
||||||
|
params.add(apiDefinition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datasourceDTO.setApiConfigurationStr(new String(Base64.getEncoder().encode(Objects.requireNonNull(JsonUtil.toJSONString(apiDefinitionListWithStatus)).toString().getBytes())));
|
||||||
|
datasourceDTO.setParamsStr(new String(Base64.getEncoder().encode(Objects.requireNonNull(JsonUtil.toJSONString(params)).toString().getBytes())));
|
||||||
|
if (success == apiDefinitionList.size()) {
|
||||||
|
datasourceDTO.setStatus("Success");
|
||||||
|
} else {
|
||||||
|
if (success > 0 && success < apiDefinitionList.size()) {
|
||||||
|
datasourceDTO.setStatus("Warning");
|
||||||
|
} else {
|
||||||
|
datasourceDTO.setStatus("Error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CoreDatasourceTask coreDatasourceTask = datasourceTaskServer.selectByDSId(datasourceDTO.getId());
|
||||||
|
TaskDTO taskDTO = new TaskDTO();
|
||||||
|
BeanUtils.copyBean(taskDTO, coreDatasourceTask);
|
||||||
|
datasourceDTO.setSyncSetting(taskDTO);
|
||||||
|
|
||||||
|
CoreDatasourceTask task = datasourceTaskServer.selectByDSId(datasourceDTO.getId());
|
||||||
|
if (task != null) {
|
||||||
|
datasourceDTO.setLastSyncTime(task.getStartTime());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (hidePw) {
|
||||||
|
Provider provider = ProviderFactory.getProvider(datasourceDTO.getType());
|
||||||
|
provider.hidePW(datasourceDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (datasourceDTO.getType().equalsIgnoreCase(DatasourceConfiguration.DatasourceType.Excel.toString())) {
|
||||||
|
datasourceDTO.setFileName(ExcelUtils.getFileName(datasource));
|
||||||
|
datasourceDTO.setSize(ExcelUtils.getSize(datasource));
|
||||||
|
}
|
||||||
|
datasourceDTO.setConfiguration(new String(Base64.getEncoder().encode(datasourceDTO.getConfiguration().getBytes())));
|
||||||
|
datasourceDTO.setCreator(coreUserManage.getUserName(Long.valueOf(datasourceDTO.getCreateBy())));
|
||||||
|
return datasourceDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
private DatasourceDTO validate(CoreDatasource coreDatasource) {
|
||||||
|
DatasourceDTO datasourceDTO = new DatasourceDTO();
|
||||||
|
BeanUtils.copyBean(datasourceDTO, coreDatasource);
|
||||||
|
try {
|
||||||
|
checkDatasourceStatus(datasourceDTO);
|
||||||
|
if (!Arrays.asList("API", "Excel", "folder").contains(coreDatasource.getType())) {
|
||||||
|
calciteProvider.updateDsPoolAfterCheckStatus(datasourceDTO);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
coreDatasource.setStatus("Error");
|
||||||
|
DEException.throwException(e.getMessage());
|
||||||
|
} finally {
|
||||||
|
coreDatasource.setStatus(datasourceDTO.getStatus());
|
||||||
|
dataSourceManage.innerEditStatus(coreDatasource);
|
||||||
|
}
|
||||||
|
datasourceDTO.setConfiguration("");
|
||||||
|
return datasourceDTO;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -452,6 +452,11 @@ defineExpose({
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="exportFromName" :label="$t('data_export.export_obj')" width="200" />
|
<el-table-column prop="exportFromName" :label="$t('data_export.export_obj')" width="200" />
|
||||||
|
<el-table-column prop="exportTime" width="180" :label="$t('data_export.export_time')">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ timestampFormatDate(scope.row.exportTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="exportFromType" width="120" :label="$t('data_export.export_from')">
|
<el-table-column prop="exportFromType" width="120" :label="$t('data_export.export_from')">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.exportFromType === 'dataset'">{{ t('data_set.data_set') }}</span>
|
<span v-if="scope.row.exportFromType === 'dataset'">{{ t('data_set.data_set') }}</span>
|
||||||
@ -464,11 +469,6 @@ defineExpose({
|
|||||||
:label="t('data_set.organization')"
|
:label="t('data_set.organization')"
|
||||||
width="200"
|
width="200"
|
||||||
/>
|
/>
|
||||||
<el-table-column prop="exportTime" width="180" :label="$t('data_export.export_time')">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ timestampFormatDate(scope.row.exportTime) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column fixed="right" prop="operate" width="90" :label="$t('commons.operating')">
|
<el-table-column fixed="right" prop="operate" width="90" :label="$t('commons.operating')">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip effect="dark" :content="t('data_set.download')" placement="top">
|
<el-tooltip effect="dark" :content="t('data_set.download')" placement="top">
|
||||||
|
@ -3,6 +3,7 @@ package io.dataease.api.ds;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||||
import io.dataease.api.ds.vo.ApiDefinition;
|
import io.dataease.api.ds.vo.ApiDefinition;
|
||||||
|
import io.dataease.api.ds.vo.BusiDsRequest;
|
||||||
import io.dataease.api.ds.vo.CoreDatasourceTaskLogDTO;
|
import io.dataease.api.ds.vo.CoreDatasourceTaskLogDTO;
|
||||||
import io.dataease.api.ds.vo.ExcelFileData;
|
import io.dataease.api.ds.vo.ExcelFileData;
|
||||||
import io.dataease.auth.DeApiPath;
|
import io.dataease.auth.DeApiPath;
|
||||||
@ -14,6 +15,7 @@ import io.dataease.extensions.datasource.dto.TableField;
|
|||||||
import io.dataease.extensions.datasource.vo.DatasourceConfiguration;
|
import io.dataease.extensions.datasource.vo.DatasourceConfiguration;
|
||||||
import io.dataease.model.BusiNodeRequest;
|
import io.dataease.model.BusiNodeRequest;
|
||||||
import io.dataease.model.BusiNodeVO;
|
import io.dataease.model.BusiNodeVO;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@ -34,96 +36,124 @@ public interface DatasourceApi {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/query/{keyWord}")
|
@GetMapping("/query/{keyWord}")
|
||||||
|
@Operation(summary = "查询")
|
||||||
List<DatasourceDTO> query(@PathVariable("keyWord") String keyWord);
|
List<DatasourceDTO> query(@PathVariable("keyWord") String keyWord);
|
||||||
|
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
DatasourceDTO save(@RequestBody DatasourceDTO dataSourceDTO) throws DEException;
|
@Operation(summary = "保存")
|
||||||
|
DatasourceDTO save(@RequestBody BusiDsRequest dataSourceDTO) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
DatasourceDTO update(@RequestBody DatasourceDTO dataSourceDTO) throws DEException;
|
@Operation(summary = "更新")
|
||||||
|
DatasourceDTO update(@RequestBody BusiDsRequest dataSourceDTO) throws DEException;
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/move")
|
@PostMapping("/move")
|
||||||
DatasourceDTO move(@RequestBody DatasourceDTO dataSourceDTO) throws DEException;
|
@Operation(summary = "移动")
|
||||||
|
DatasourceDTO move(@RequestBody BusiDsRequest dataSourceDTO) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/reName")
|
@PostMapping("/reName")
|
||||||
DatasourceDTO reName(@RequestBody DatasourceDTO dataSourceDTO) throws DEException;
|
@Operation(summary = "重命名")
|
||||||
|
DatasourceDTO reName(@RequestBody BusiDsRequest dataSourceDTO) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/createFolder")
|
@PostMapping("/createFolder")
|
||||||
DatasourceDTO createFolder(@RequestBody DatasourceDTO dataSourceDTO) throws DEException;
|
@Operation(summary = "新建文件夹")
|
||||||
|
DatasourceDTO createFolder(@RequestBody BusiDsRequest dataSourceDTO) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/checkRepeat")
|
@PostMapping("/checkRepeat")
|
||||||
boolean checkRepeat(@RequestBody DatasourceDTO dataSourceDTO) throws DEException;
|
@Operation(summary = "校验重复")
|
||||||
|
boolean checkRepeat(@RequestBody BusiDsRequest dataSourceDTO) throws DEException;
|
||||||
|
|
||||||
@GetMapping("/types")
|
@GetMapping("/types")
|
||||||
|
@Operation(summary = "数据源类型")
|
||||||
List<DatasourceConfiguration.DatasourceType> datasourceTypes() throws DEException;
|
List<DatasourceConfiguration.DatasourceType> datasourceTypes() throws DEException;
|
||||||
|
|
||||||
@PostMapping("/validate")
|
@PostMapping("/validate")
|
||||||
DatasourceDTO validate(@RequestBody DatasourceDTO dataSourceDTO) throws DEException;
|
@Operation(summary = "校验")
|
||||||
|
DatasourceDTO validate(@RequestBody BusiDsRequest dataSourceDTO) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/getSchema")
|
@PostMapping("/getSchema")
|
||||||
List<String> getSchema(@RequestBody DatasourceDTO dataSourceDTO) throws DEException;
|
@Operation(summary = "获取 schema")
|
||||||
|
List<String> getSchema(@RequestBody BusiDsRequest dataSourceDTO) throws DEException;
|
||||||
|
|
||||||
@DePermit({"#p0+':manage'"})
|
@DePermit({"#p0+':manage'"})
|
||||||
@GetMapping("/validate/{datasourceId}")
|
@GetMapping("/validate/{datasourceId}")
|
||||||
|
@Operation(summary = "校验")
|
||||||
DatasourceDTO validate(@PathVariable("datasourceId") Long datasourceId) throws DEException;
|
DatasourceDTO validate(@PathVariable("datasourceId") Long datasourceId) throws DEException;
|
||||||
|
|
||||||
@DePermit({"#p0+':manage'"})
|
@DePermit({"#p0+':manage'"})
|
||||||
@PostMapping("/perDelete/{datasourceId}")
|
@PostMapping("/perDelete/{datasourceId}")
|
||||||
|
@Operation(summary = "是否有数据集正在使用此数据源")
|
||||||
boolean perDelete(@PathVariable("datasourceId") Long datasourceId);
|
boolean perDelete(@PathVariable("datasourceId") Long datasourceId);
|
||||||
|
|
||||||
@DePermit({"#p0+':manage'"})
|
@DePermit({"#p0+':manage'"})
|
||||||
@GetMapping("/delete/{datasourceId}")
|
@GetMapping("/delete/{datasourceId}")
|
||||||
|
@Operation(summary = "删除")
|
||||||
void delete(@PathVariable("datasourceId") Long datasourceId) throws DEException;
|
void delete(@PathVariable("datasourceId") Long datasourceId) throws DEException;
|
||||||
|
|
||||||
@DePermit({"#p0+':read'"})
|
@DePermit({"#p0+':read'"})
|
||||||
@GetMapping("/get/{datasourceId}")
|
@GetMapping("/get/{datasourceId}")
|
||||||
|
@Operation(summary = "数据源详情")
|
||||||
DatasourceDTO get(@PathVariable("datasourceId") Long datasourceId) throws DEException;
|
DatasourceDTO get(@PathVariable("datasourceId") Long datasourceId) throws DEException;
|
||||||
|
|
||||||
DatasourceDTO innerGet(Long datasourceId) throws DEException;
|
|
||||||
|
|
||||||
List<DatasourceDTO> innerList(List<Long> ids, List<String> types) throws DEException;
|
|
||||||
|
|
||||||
@DePermit({"#p0+':read'"})
|
@DePermit({"#p0+':read'"})
|
||||||
@GetMapping("/hidePw/{datasourceId}")
|
@GetMapping("/hidePw/{datasourceId}")
|
||||||
|
@Operation(summary = "数据源详情")
|
||||||
DatasourceDTO hidePw(@PathVariable("datasourceId") Long datasourceId) throws DEException;
|
DatasourceDTO hidePw(@PathVariable("datasourceId") Long datasourceId) throws DEException;
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/getTableField")
|
@PostMapping("/getTableField")
|
||||||
|
@Operation(summary = "获取表字段")
|
||||||
List<TableField> getTableField(@RequestBody Map<String, String> req) throws DEException;
|
List<TableField> getTableField(@RequestBody Map<String, String> req) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/syncApiTable")
|
@PostMapping("/syncApiTable")
|
||||||
|
@Operation(summary = "同步API数据表")
|
||||||
void syncApiTable(@RequestBody Map<String, String> req) throws DEException;
|
void syncApiTable(@RequestBody Map<String, String> req) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/syncApiDs")
|
@PostMapping("/syncApiDs")
|
||||||
|
@Operation(summary = "同步API数据源")
|
||||||
void syncApiDs(@RequestBody Map<String, String> req) throws Exception;
|
void syncApiDs(@RequestBody Map<String, String> req) throws Exception;
|
||||||
|
|
||||||
@PostMapping("tree")
|
@PostMapping("tree")
|
||||||
|
@Operation(summary = "数据源列表")
|
||||||
List<BusiNodeVO> tree(@RequestBody BusiNodeRequest request) throws DEException;
|
List<BusiNodeVO> tree(@RequestBody BusiNodeRequest request) throws DEException;
|
||||||
|
|
||||||
|
|
||||||
@DePermit({"#p0.datasourceId+':read'"})
|
@DePermit({"#p0.datasourceId+':read'"})
|
||||||
@PostMapping("getTables")
|
@PostMapping("getTables")
|
||||||
|
@Operation(summary = "获取表")
|
||||||
List<DatasetTableDTO> getTables(@RequestBody DatasetTableDTO datasetTableDTO) throws DEException;
|
List<DatasetTableDTO> getTables(@RequestBody DatasetTableDTO datasetTableDTO) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/checkApiDatasource")
|
@PostMapping("/checkApiDatasource")
|
||||||
|
@Operation(summary = "校验API数据源")
|
||||||
ApiDefinition checkApiDatasource(@RequestBody Map<String, String> data) throws DEException;
|
ApiDefinition checkApiDatasource(@RequestBody Map<String, String> data) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/uploadFile")
|
@PostMapping("/uploadFile")
|
||||||
|
@Operation(summary = "上传文件")
|
||||||
ExcelFileData excelUpload(@RequestParam("file") MultipartFile file, @RequestParam("id") long datasourceId, @RequestParam("editType") Integer editType) throws DEException;
|
ExcelFileData excelUpload(@RequestParam("file") MultipartFile file, @RequestParam("id") long datasourceId, @RequestParam("editType") Integer editType) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/previewData")
|
@PostMapping("/previewData")
|
||||||
|
@Operation(summary = "预览数据")
|
||||||
Map<String, Object> previewDataWithLimit(@RequestBody Map<String, Object> req) throws DEException;
|
Map<String, Object> previewDataWithLimit(@RequestBody Map<String, Object> req) throws DEException;
|
||||||
|
|
||||||
@PostMapping("/latestUse")
|
@PostMapping("/latestUse")
|
||||||
|
@Operation(summary = "最近常用")
|
||||||
public List<String> latestUse();
|
public List<String> latestUse();
|
||||||
|
|
||||||
@GetMapping("showFinishPage")
|
@GetMapping("showFinishPage")
|
||||||
|
@Operation(summary = "是否显示完成页面")
|
||||||
public boolean showFinishPage() throws DEException;
|
public boolean showFinishPage() throws DEException;
|
||||||
|
|
||||||
@PostMapping("setShowFinishPage")
|
@PostMapping("setShowFinishPage")
|
||||||
|
@Operation(summary = "是否显示完成页面")
|
||||||
public void setShowFinishPage() throws DEException;
|
public void setShowFinishPage() throws DEException;
|
||||||
|
|
||||||
@PostMapping("/listSyncRecord/{dsId}/{goPage}/{pageSize}")
|
@PostMapping("/listSyncRecord/{dsId}/{goPage}/{pageSize}")
|
||||||
|
@Operation(summary = "更新日志")
|
||||||
IPage<CoreDatasourceTaskLogDTO> listSyncRecord(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @PathVariable("dsId") Long dsId);
|
IPage<CoreDatasourceTaskLogDTO> listSyncRecord(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @PathVariable("dsId") Long dsId);
|
||||||
|
|
||||||
|
DatasourceDTO innerGet(Long datasourceId) throws DEException;
|
||||||
|
|
||||||
|
List<DatasourceDTO> innerList(List<Long> ids, List<String> types) throws DEException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
package io.dataease.api.ds.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import io.dataease.extensions.datasource.dto.TaskDTO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusiDsRequest implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1175287571828910222L;
|
||||||
|
|
||||||
|
@JsonSerialize(using= ToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@JsonSerialize(using= ToStringSerializer.class)
|
||||||
|
@Schema(description = "父ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long pid;
|
||||||
|
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String name;
|
||||||
|
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String nodeType;
|
||||||
|
@Schema(description = "操作类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String action;
|
||||||
|
private String description;
|
||||||
|
private String type;
|
||||||
|
private String typeAlias;
|
||||||
|
private String catalog;
|
||||||
|
private String catalogDesc;
|
||||||
|
private String configuration;
|
||||||
|
private String apiConfigurationStr;
|
||||||
|
private String paramsStr;
|
||||||
|
private Long createTime;
|
||||||
|
private Long updateTime;
|
||||||
|
private Long updateBy;
|
||||||
|
private String createBy;
|
||||||
|
private String creator;
|
||||||
|
private String status;
|
||||||
|
private TaskDTO syncSetting;
|
||||||
|
private Integer editType;
|
||||||
|
private String fileName;
|
||||||
|
private String size;
|
||||||
|
private Long lastSyncTime;
|
||||||
|
private String qrtzInstance;
|
||||||
|
private String taskStatus;
|
||||||
|
private Boolean enableDataFill;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user