Commit b0a6d1b9 authored by liqin's avatar liqin 💬

bug fixed

parent 00034b5a
...@@ -94,6 +94,14 @@ public class FileUploadController extends BaseController { ...@@ -94,6 +94,14 @@ public class FileUploadController extends BaseController {
failureCount++; failureCount++;
continue; continue;
} }
if (file.getSize() == 0L) {
handleResult.setFileName("");
handleResult.setFileUrl("");
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件大小为0");
failureCount++;
continue;
}
String extName = FilenameUtils.getExtension(originalFilename); String extName = FilenameUtils.getExtension(originalFilename);
boolean anyMatch = Arrays.stream(DATUM_TYPE).anyMatch(s -> Objects.equals(s, extName.toUpperCase())); boolean anyMatch = Arrays.stream(DATUM_TYPE).anyMatch(s -> Objects.equals(s, extName.toUpperCase()));
...@@ -187,7 +195,7 @@ public class FileUploadController extends BaseController { ...@@ -187,7 +195,7 @@ public class FileUploadController extends BaseController {
@RequiresPermissions("file:image:upload") @RequiresPermissions("file:image:upload")
@ApiOperation(value = "单图片上传(封面/缩略图)", notes = "单图片上传(封面/缩略图)") @ApiOperation(value = "单图片上传(封面/缩略图)", notes = "单图片上传(封面/缩略图)")
public Map<String, Object> uploadImage(@RequestParam(value = "file") MultipartFile uploadFile) throws Exception { public Map<String, Object> uploadImage(@RequestParam(value = "file") MultipartFile uploadFile) throws Exception {
if (uploadFile == null || uploadFile.getSize() == 0) { if (uploadFile == null || uploadFile.getSize() == 0L) {
throw new InterfaceException(RESPONSE_CODE_ENUM.SERVER_ERROR.getResultCode(), "没有文件可供上传"); throw new InterfaceException(RESPONSE_CODE_ENUM.SERVER_ERROR.getResultCode(), "没有文件可供上传");
} }
String fileName = uploadFile.getOriginalFilename(); String fileName = uploadFile.getOriginalFilename();
...@@ -269,6 +277,14 @@ public class FileUploadController extends BaseController { ...@@ -269,6 +277,14 @@ public class FileUploadController extends BaseController {
failureCount++; failureCount++;
continue; continue;
} }
if (file.getSize() == 0L) {
handleResult.setFileName("");
handleResult.setFileUrl("");
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件大小为0");
failureCount++;
continue;
}
String extName = FilenameUtils.getExtension(originalFilename); String extName = FilenameUtils.getExtension(originalFilename);
boolean anyMatch = Arrays.stream(AUDIO_TYPE).anyMatch(s -> Objects.equals(s, extName.toUpperCase())); boolean anyMatch = Arrays.stream(AUDIO_TYPE).anyMatch(s -> Objects.equals(s, extName.toUpperCase()));
...@@ -371,6 +387,14 @@ public class FileUploadController extends BaseController { ...@@ -371,6 +387,14 @@ public class FileUploadController extends BaseController {
failureCount++; failureCount++;
continue; continue;
} }
if (file.getSize() == 0L) {
handleResult.setFileName("");
handleResult.setFileUrl("");
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件大小为0");
failureCount++;
continue;
}
String extName = FilenameUtils.getExtension(originalFilename); String extName = FilenameUtils.getExtension(originalFilename);
boolean anyMatch = Arrays.stream(VIDEO_TYPE).anyMatch(s -> Objects.equals(s, extName.toUpperCase())); boolean anyMatch = Arrays.stream(VIDEO_TYPE).anyMatch(s -> Objects.equals(s, extName.toUpperCase()));
...@@ -471,6 +495,14 @@ public class FileUploadController extends BaseController { ...@@ -471,6 +495,14 @@ public class FileUploadController extends BaseController {
failureCount++; failureCount++;
continue; continue;
} }
if (file.getSize() == 0L) {
handleResult.setFileName("");
handleResult.setFileUrl("");
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件大小为0");
failureCount++;
continue;
}
String extName = FilenameUtils.getExtension(originalFilename); String extName = FilenameUtils.getExtension(originalFilename);
boolean anyMatch = Arrays.stream(VIDEO_TYPE).anyMatch(s -> Objects.equals(s, extName.toUpperCase())); boolean anyMatch = Arrays.stream(VIDEO_TYPE).anyMatch(s -> Objects.equals(s, extName.toUpperCase()));
......
...@@ -119,8 +119,8 @@ public class VideoContentCatController extends BaseController { ...@@ -119,8 +119,8 @@ public class VideoContentCatController extends BaseController {
lambdaQueryWrapper = lambdaQueryWrapper.select(VideoContent::getId).select(VideoContent::getVideoContentCopyrightOwnerId); lambdaQueryWrapper = lambdaQueryWrapper.select(VideoContent::getId).select(VideoContent::getVideoContentCopyrightOwnerId);
List<VideoContent> videoContentList = this.videoContentService.list(lambdaQueryWrapper); List<VideoContent> videoContentList = this.videoContentService.list(lambdaQueryWrapper);
if (!videoContentList.isEmpty()) { if (!videoContentList.isEmpty()) {
final Set<String> assetCopyrightOwnerIdList = videoContentList.stream().map(VideoContent::getVideoContentCopyrightOwnerId).collect(Collectors.toSet()); final Set<String> videoContentCopyrightOwnerIdList = videoContentList.stream().map(VideoContent::getVideoContentCopyrightOwnerId).collect(Collectors.toSet());
List<CopyrightOwner> copyrightOwnerList = this.copyrightOwnerService.listByIds(assetCopyrightOwnerIdList); List<CopyrightOwner> copyrightOwnerList = this.copyrightOwnerService.listByIds(videoContentCopyrightOwnerIdList);
String copyrightOwnerName = copyrightOwnerList.stream().map(CopyrightOwner::getName).collect(Collectors.joining("、")); String copyrightOwnerName = copyrightOwnerList.stream().map(CopyrightOwner::getName).collect(Collectors.joining("、"));
videoContentCat.setCopyrightOwnerName(copyrightOwnerName); videoContentCat.setCopyrightOwnerName(copyrightOwnerName);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment