瀏覽代碼

add 数据迁移 增加日志删除接口

lvxianyun 2 年之前
父節點
當前提交
d40f5defe3

+ 13 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/controller/DataMigrationController.java

@@ -211,6 +211,19 @@ public class DataMigrationController {
         return logService.queryMigrationLog(context, request);
     }
 
+    /**
+     * 根据条件 删除操作日志 物理删除
+     * @param request
+     * {
+     *     "filters": "projectId='Pj9909990004';sign=2;type='create';tableName='dt_relation';creationTime='20220125121146'"
+     * }
+     * @return
+     */
+    @PostMapping("/deleteLog")
+    public AdmResponse deleteMigrateForLog(@RequestBody AdmQueryCriteria request) {
+        InstanceUrlParam context = AdmContextUtil.toDmpContext();
+        return logService.deleteMigrationLog(context, request);
+    }
 
 
 

+ 1 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/IMigrationLogService.java

@@ -15,4 +15,5 @@ import com.persagy.proxy.common.entity.InstanceUrlParam;
 public interface IMigrationLogService {
 
     AdmResponse queryMigrationLog(InstanceUrlParam context, AdmQueryCriteria request);
+    AdmResponse deleteMigrationLog(InstanceUrlParam context, AdmQueryCriteria request);
 }

+ 13 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/MigrationLogServiceImpl.java

@@ -65,6 +65,19 @@ public class MigrationLogServiceImpl implements IMigrationLogService {
         }
     }
 
+    @Override
+    public AdmResponse deleteMigrationLog(InstanceUrlParam context, AdmQueryCriteria request) {
+        QueryCriteria queryCriteria = AdmQueryCriteriaHelper.toDmpCriteria(request);
+        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());
+        }
+    }
+
 
     /***
      * Description: 查询所有关系类型