|
@@ -37,43 +37,28 @@ import java.util.stream.Collectors;
|
|
|
@Slf4j
|
|
|
public class MigrationLogServiceImpl implements IMigrationLogService {
|
|
|
@Override
|
|
|
- public AdmResponse queryMigrationLog(InstanceUrlParam context, QueryCriteria queryCriteria) {
|
|
|
+ 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(queryCriteria.isOnlyCount()){
|
|
|
- response.setTotal(null);
|
|
|
- response.setCount(total);
|
|
|
- }else {
|
|
|
- response.setTotal(total);
|
|
|
- }
|
|
|
- response.setPageNumber(queryCriteria.getPage() == null ? 0 : queryCriteria.getPage().intValue());
|
|
|
- response.setPageSize(queryCriteria.getSize() == null ? 50 : queryCriteria.getSize().intValue());
|
|
|
- return response;
|
|
|
- } else {
|
|
|
- return AdmResponse.failure(result.getMessage());
|
|
|
+ result.setData(syncDatas);
|
|
|
}
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AdmResponse deleteMigrationLog(InstanceUrlParam context, QueryCriteria queryCriteria) {
|
|
|
+ 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;
|
|
|
}
|
|
|
|
|
|
|