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

This commit is contained in:
YunaiV
2025-08-03 19:53:54 +08:00
parent 896113bb40
commit dd1696878a

View File

@@ -43,7 +43,7 @@ public class FileController {
@PostMapping("/upload")
@Operation(summary = "上传文件", description = "模式一:后端上传文件")
public CommonResult<String> uploadFile(FileUploadReqVO uploadReqVO) throws Exception {
public CommonResult<String> uploadFile(@Valid FileUploadReqVO uploadReqVO) throws Exception {
MultipartFile file = uploadReqVO.getFile();
byte[] content = IoUtil.readBytes(file.getInputStream());
return success(fileService.createFile(content, file.getOriginalFilename(),