|
@@ -23,6 +23,8 @@ import com.fdkankan.scene.service.ISceneProService;
|
|
|
import com.fdkankan.scene.service.ISceneUploadService;
|
|
|
import com.fdkankan.scene.vo.DeleteFileParamVO;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.Set;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -84,7 +86,12 @@ public class SceneUploadServiceImpl extends ServiceImpl<ISceneUploadMapper, Scen
|
|
|
public ResultData delete(DeleteFileParamVO param) throws Exception {
|
|
|
String userEditPath = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum());
|
|
|
List<String> filePaths = new ArrayList<>();
|
|
|
+ Set<String> hasDelete = new HashSet<>();
|
|
|
for (String fileName : param.getFileNames()) {
|
|
|
+ if(hasDelete.contains(fileName)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ hasDelete.add(fileName);
|
|
|
String key = userEditPath + fileName;
|
|
|
filePaths.add(key);
|
|
|
uploadToOssUtil.delete(key);
|