feat: 存储管理适配后端 API

This commit is contained in:
2023-12-30 20:37:00 +08:00
parent 9a30da9334
commit 89e4326290
14 changed files with 669 additions and 68 deletions

View File

@@ -82,6 +82,7 @@ public class CommonController {
@Operation(summary = "上传文件", description = "上传文件")
@PostMapping("/file")
public R<String> upload(@NotNull(message = "文件不能为空") MultipartFile file) {
ValidationUtils.throwIf(projectProperties.isProduction(), "演示环境不支持上传文件");
ValidationUtils.throwIf(file::isEmpty, "文件不能为空");
FileInfo fileInfo = fileService.upload(file);
return R.ok("上传成功", fileInfo.getUrl());