|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
import com.fdkankan.fusion.common.FilePath;
|
|
import com.fdkankan.fusion.common.FilePath;
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
|
|
+import com.fdkankan.fusion.common.util.VideoUtil;
|
|
import com.fdkankan.fusion.entity.CaseEntity;
|
|
import com.fdkankan.fusion.entity.CaseEntity;
|
|
import com.fdkankan.fusion.entity.CaseVideoFolder;
|
|
import com.fdkankan.fusion.entity.CaseVideoFolder;
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
@@ -23,9 +24,11 @@ import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.lang.reflect.Field;
|
|
import java.lang.reflect.Field;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.LinkedHashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -81,8 +84,9 @@ public class CaseVideoServiceImpl extends ServiceImpl<ICaseVideoMapper, CaseVide
|
|
this.deleteByFolderId(folderId);
|
|
this.deleteByFolderId(folderId);
|
|
List<CaseVideo> videoList = new ArrayList<>();
|
|
List<CaseVideo> videoList = new ArrayList<>();
|
|
Integer sort = 1;
|
|
Integer sort = 1;
|
|
|
|
+ LinkedHashSet<String> filePath = new LinkedHashSet<>();
|
|
for (MultipartFile file : files) {
|
|
for (MultipartFile file : files) {
|
|
- String ossPath = uploadService.uploadFile(file, true, String.format(FilePath.VIDEO_OSS_PATH,videoFolder.getVideoFolderId()));
|
|
|
|
|
|
+ String ossPath = uploadService.uploadFile(file, true, String.format(FilePath.VIDEO_OSS_PATH,videoFolder.getVideoFolderId()),filePath);
|
|
CaseVideo caseVideo = new CaseVideo();
|
|
CaseVideo caseVideo = new CaseVideo();
|
|
caseVideo.setFolderId(videoFolder.getVideoFolderId());
|
|
caseVideo.setFolderId(videoFolder.getVideoFolderId());
|
|
caseVideo.setVideoPath(ossPath);
|
|
caseVideo.setVideoPath(ossPath);
|
|
@@ -92,6 +96,10 @@ public class CaseVideoServiceImpl extends ServiceImpl<ICaseVideoMapper, CaseVide
|
|
sort ++;
|
|
sort ++;
|
|
}
|
|
}
|
|
this.saveBatch(videoList);
|
|
this.saveBatch(videoList);
|
|
|
|
+ String mergeLocalPath = VideoUtil.videoMerge(filePath, FilePath.VIDEO_LOCAL_PATH);
|
|
|
|
+ uploadToOssUtil.upload(mergeLocalPath,String.format(FilePath.VIDEO_OSS_PATH,videoFolder.getVideoFolderId()));
|
|
|
|
+ File file = new File(mergeLocalPath);
|
|
|
|
+ file.deleteOnExit();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|