查询目标源所有用户

This commit is contained in:
hekaiyu 2025-10-15 15:55:06 +08:00
parent acd4edd80b
commit 83f027d1dd

View File

@ -19,7 +19,9 @@ import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.base.entity.StasDataSource; import org.jeecg.modules.base.entity.StasDataSource;
import org.jeecg.dataSource.service.IStasDataSourceService; import org.jeecg.dataSource.service.IStasDataSourceService;
import org.jeecg.modules.base.entity.StasSyncStrategy; import org.jeecg.modules.base.entity.StasSyncStrategy;
import org.jeecg.modules.base.entity.StasTaskConfig;
import org.jeecg.modules.base.service.BaseCommonService; import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.taskConfig.service.IStasTaskConfigService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
@ -40,6 +42,8 @@ public class StasDataSourceController extends JeecgController<StasDataSource, IS
@Autowired @Autowired
private IStasDataSourceService stasDataSourceService; private IStasDataSourceService stasDataSourceService;
@Autowired
private IStasTaskConfigService stasTaskConfigService;
/** /**
* 分页列表查询 * 分页列表查询
@ -77,7 +81,7 @@ public class StasDataSourceController extends JeecgController<StasDataSource, IS
@AutoLog(value = "根据数据源名称查询所有表") @AutoLog(value = "根据数据源名称查询所有表")
@Operation(summary = "根据数据源名称查询所有表") @Operation(summary = "根据数据源名称查询所有表")
@GetMapping(value = "/userList") @GetMapping(value = "/userList")
public Result<?> queryTargetUserList(@RequestParam(name="sourceId",required=false) String sourceId) { public Result<?> queryUserList(@RequestParam(name="sourceId",required=false) String sourceId) {
List<String> tableNameList= stasDataSourceService.queryUserList(sourceId); List<String> tableNameList= stasDataSourceService.queryUserList(sourceId);
if (tableNameList != null && !"".equals(tableNameList)){ if (tableNameList != null && !"".equals(tableNameList)){
return Result.OK(tableNameList); return Result.OK(tableNameList);
@ -85,6 +89,24 @@ public class StasDataSourceController extends JeecgController<StasDataSource, IS
return Result.error("获取源端用户为空"); return Result.error("获取源端用户为空");
} }
/**
* 查询目标源所有用户
*
* @param taskId
* @return
*/
@AutoLog(value = "查询目标源所有用户")
@Operation(summary = "查询目标源所有用户")
@GetMapping(value = "/targetUser")
public Result<?> queryTargetUserList(@RequestParam(name="taskId",required=false) String taskId) {
StasTaskConfig taskConfig = stasTaskConfigService.getById(taskId);
List<String> tableNameList= stasDataSourceService.queryUserList(taskConfig.getSourceId());
if (tableNameList != null && !"".equals(tableNameList)){
return Result.OK(tableNameList);
}
return Result.error("获取源端用户为空");
}
/** /**
* 查询数据源表 * 查询数据源表
* *