|
@@ -54,10 +54,14 @@ public class UploadService {
|
|
|
if(filePathSet !=null){
|
|
|
filePathSet.add(path);
|
|
|
}
|
|
|
- VideoUtil.ffmpegVideo(path,path.replace(suffixName,".jpg"),"200","200");
|
|
|
-
|
|
|
+ if(file.getName().toLowerCase().endsWith(".mp4")){
|
|
|
+ VideoUtil.ffmpegVideo(path,path.replace(suffixName,".jpg"),"200","200");
|
|
|
+ uploadToOssUtil.upload(path.replace(suffixName,".jpg"),filePathAdd+ fileName + ".jpg");
|
|
|
+ if(!uploadToOssUtil.existKey(filePathAdd+ fileName + ".jpg")){
|
|
|
+ throw new BusinessException(ResultCode.UPLOAD_ERROR.code,ResultCode.UPLOAD_ERROR.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
uploadToOssUtil.upload(path,filePathAdd+ fileName + suffixName);
|
|
|
- uploadToOssUtil.upload(path.replace(suffixName,".jpg"),filePathAdd+ fileName + ".jpg");
|
|
|
if(!uploadToOssUtil.existKey(filePathAdd + fileName + suffixName)){
|
|
|
throw new BusinessException(ResultCode.UPLOAD_ERROR.code,ResultCode.UPLOAD_ERROR.msg);
|
|
|
}
|