|
@@ -37,45 +37,28 @@ import java.util.stream.Collectors;
|
|
|
@Slf4j
|
|
|
public class MigrationLogServiceImpl implements IMigrationLogService {
|
|
|
@Override
|
|
|
- public AdmResponse queryMigrationLog(InstanceUrlParam context, AdmQueryCriteria request) {
|
|
|
- QueryCriteria queryCriteria = AdmQueryCriteriaHelper.toDmpCriteria(request);
|
|
|
+ public CommonResult queryMigrationLog(InstanceUrlParam context, QueryCriteria queryCriteria) {
|
|
|
String groupCode = context.getGroupCode();
|
|
|
String projectId = context.getProjectId();
|
|
|
CommonResult<List<SyncData>> result = DigitalMigrateLogFacade.query(groupCode, projectId, context.getAppId(), context.getUserId(),queryCriteria);
|
|
|
if(result.getResult().equals(DmpResult.SUCCESS)){
|
|
|
if(CollUtil.isEmpty(result.getData())){
|
|
|
- return AdmResponse.success();
|
|
|
+ return result;
|
|
|
}
|
|
|
// 处理返回值
|
|
|
List<SyncData> syncDatas = result.getData();
|
|
|
processSynDatas(groupCode, projectId, syncDatas);
|
|
|
- AdmResponse response = AdmResponse.success(syncDatas);
|
|
|
- Long total = result.getCount() == null ? null : result.getCount().longValue();
|
|
|
- if(request.isOnlyCount()){
|
|
|
- response.setTotal(null);
|
|
|
- response.setCount(total);
|
|
|
- }else {
|
|
|
- response.setTotal(total);
|
|
|
- }
|
|
|
- response.setPageNumber(request.getPageNumber());
|
|
|
- response.setPageSize(request.getPageSize());
|
|
|
- return response;
|
|
|
- } else {
|
|
|
- return AdmResponse.failure(result.getMessage());
|
|
|
+ result.setData(syncDatas);
|
|
|
}
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AdmResponse deleteMigrationLog(InstanceUrlParam context, AdmQueryCriteria request) {
|
|
|
- QueryCriteria queryCriteria = AdmQueryCriteriaHelper.toDmpCriteria(request);
|
|
|
+ public CommonResult deleteMigrationLog(InstanceUrlParam context, QueryCriteria queryCriteria) {
|
|
|
String groupCode = context.getGroupCode();
|
|
|
String projectId = context.getProjectId();
|
|
|
CommonResult result = DigitalMigrateLogFacade.deleteAllLog(groupCode, projectId, context.getAppId(), context.getUserId(),queryCriteria);
|
|
|
- if(result.getMessage().equals(DmpResult.SUCCESS)){
|
|
|
- return AdmResponse.success();
|
|
|
- }else{
|
|
|
- return AdmResponse.failure(result.getMessage());
|
|
|
- }
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
|