|
@@ -103,6 +103,14 @@ public class FileUploadServiceImpl extends ServiceImpl<FileMapper, FileInfo> imp
|
|
|
|
|
|
List<String> chunks = minioCommonService
|
|
|
.listObjectNames(minioCommonService.getChuckBucketName(null),requestData.getFileMd5());
|
|
|
+ if (CollUtil.isEmpty(chunks)){
|
|
|
+ throw new BusinessException(ResponseCode.A0400.getCode(), "分片文件数量为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ FileInfo fileInfo = queryFileInfosByFileMd5(requestData.getFileMd5());
|
|
|
+ if (null==fileInfo){
|
|
|
+ throw new BusinessException(ResponseCode.A0400.getCode(), "文件信息为空");
|
|
|
+ }
|
|
|
|
|
|
String fileName = requestData.getFileName();
|
|
|
String suffix = fileName.substring(fileName.lastIndexOf("."));
|
|
@@ -112,8 +120,6 @@ public class FileUploadServiceImpl extends ServiceImpl<FileMapper, FileInfo> imp
|
|
|
if(minioCommonService.composeObject(requestData.getBucketName(),chunks,fileName)){
|
|
|
|
|
|
String url = minioCommonService.getObjectUrl(requestData.getBucketName(),fileName,60);
|
|
|
-
|
|
|
- FileInfo fileInfo = queryFileInfosByFileMd5(requestData.getFileMd5());
|
|
|
fileInfo.setUploadStatus(UPLOAD_SUCCESS);
|
|
|
fileInfo.setFileName(fileName);
|
|
|
fileInfo.setFilePath(url);
|