Merge pull request #6480 from dataease/pr@dev-v2@perf_ds_status

perf: 数据源同步状态接口
This commit is contained in:
fit2cloud-chenyw 2023-11-01 15:38:13 +08:00 committed by GitHub
commit 4234edf99f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View File

@ -87,6 +87,13 @@ public class DataSourceManage {
coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE,OptConstants.OPT_TYPE.UPDATE);
}
@XpackInteract(value = "datasourceResourceTree", before = false)
public void innerEditStatus(CoreDatasource coreDatasource) {
UpdateWrapper<CoreDatasource> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", coreDatasource.getId());
coreDatasourceMapper.update(coreDatasource, updateWrapper);
}
@XpackInteract(value = "datasourceResourceTree", before = false)
public void move(DatasourceDTO dataSourceDTO) {
Long id = dataSourceDTO.getId();

View File

@ -12,8 +12,6 @@ import io.dataease.api.dataset.dto.DatasetTableDTO;
import io.dataease.api.dataset.dto.PreviewSqlDTO;
import io.dataease.api.ds.DatasourceApi;
import io.dataease.api.ds.vo.*;
import io.dataease.api.permissions.auth.api.InteractiveAuthApi;
import io.dataease.api.permissions.auth.dto.BusiResourceEditor;
import io.dataease.commons.constants.TaskStatus;
import io.dataease.commons.utils.CommonThreadPool;
import io.dataease.constant.DataSourceType;
@ -43,7 +41,6 @@ import io.dataease.utils.*;
import jakarta.annotation.Resource;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestBody;
@ -88,8 +85,6 @@ public class DatasourceServer implements DatasourceApi {
@Resource
private DatasetDataManage datasetDataManage;
@Autowired(required = false)
private InteractiveAuthApi interactiveAuthApi;
@Resource
private CoreUserManage coreUserManage;
@ -618,14 +613,12 @@ public class DatasourceServer implements DatasourceApi {
record.setStatus(coreDatasource.getStatus());
QueryWrapper<CoreDatasource> wrapper = new QueryWrapper<>();
wrapper.eq("id", coreDatasource.getId());
datasourceMapper.update(record, wrapper);
if (interactiveAuthApi != null) {
BusiResourceEditor editor = new BusiResourceEditor();
editor.setId((long) coreDatasource.getId());
editor.setName(coreDatasource.getName());
editor.setExtraFlag(getExtraFlag(coreDatasource.getType(), coreDatasource.getStatus()));
interactiveAuthApi.editResource(editor);
CoreDatasource originData = datasourceMapper.selectById(coreDatasource.getId());
String originStatus = originData.getStatus();
if (StringUtils.equals(coreDatasource.getStatus(), originStatus)) {
return datasourceDTO;
}
dataSourceManage.innerEditStatus(coreDatasource);
return datasourceDTO;
}

@ -1 +1 @@
Subproject commit 91f3ae793906139d6d761704b95c162de7d26a3d
Subproject commit bd2abefb4c91e6399a7de3a6f4dcbadb5633163b