Commit dd1696878a4aa4d63ece40129a11b31f1d964892

Authored by YunaiV
1 parent 896113bb

fix:【infra 基础设施】FileController 的 uploadFile 接口,缺少 @Valid 注解

yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
@@ -43,7 +43,7 @@ public class FileController { @@ -43,7 +43,7 @@ public class FileController {
43 43
44 @PostMapping("/upload") 44 @PostMapping("/upload")
45 @Operation(summary = "上传文件", description = "模式一:后端上传文件") 45 @Operation(summary = "上传文件", description = "模式一:后端上传文件")
46 - public CommonResult<String> uploadFile(FileUploadReqVO uploadReqVO) throws Exception { 46 + public CommonResult<String> uploadFile(@Valid FileUploadReqVO uploadReqVO) throws Exception {
47 MultipartFile file = uploadReqVO.getFile(); 47 MultipartFile file = uploadReqVO.getFile();
48 byte[] content = IoUtil.readBytes(file.getInputStream()); 48 byte[] content = IoUtil.readBytes(file.getInputStream());
49 return success(fileService.createFile(content, file.getOriginalFilename(), 49 return success(fileService.createFile(content, file.getOriginalFilename(),