|
@@ -3,6 +3,8 @@ package com.fdkankan.scene.service.impl;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.exceptions.ExceptionUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
|
import com.fdkankan.common.constant.CommonSuccessStatus;
|
|
@@ -83,6 +85,15 @@ public class SceneCleanOrigServiceImpl extends ServiceImpl<ISceneCleanOrigMapper
|
|
|
String dataSource = scene.getDataSource();
|
|
|
if(StrUtil.isNotEmpty(dataSource)){
|
|
|
String homePath = dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, ConstantFilePath.OSS_PREFIX);
|
|
|
+ //由于国内测试和生产用的bucket是同一个,这里需要做一个安全校验,保证不会删错
|
|
|
+ String fileContent = fYunFileService.getFileContent(homePath.concat("/").concat("data.fdage"));
|
|
|
+ JSONObject jsonObject = JSON.parseObject(fileContent);
|
|
|
+ String snCode = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
+ String uuidTime = jsonObject.getString("jsonObject");
|
|
|
+ if(!homePath.contains(snCode) || !homePath.contains(snCode.concat("_").concat(uuidTime))){
|
|
|
+ this.saveLog(scene.getNum(), CommonSuccessStatus.Fail.code(), "原始资源路径不正确");
|
|
|
+ return;
|
|
|
+ }
|
|
|
fYunFileService.deleteFolder(homePath);
|
|
|
}
|
|
|
this.saveLog(scene.getNum(), CommonSuccessStatus.SUCCESS.code(), null);
|