Skip to content

Commit

Permalink
chore: 移除上传文件时的多余校验
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Oct 9, 2024
1 parent 67589a7 commit 8466105
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import top.continew.admin.system.model.query.RoleQuery;
import top.continew.admin.system.model.resp.FileUploadResp;
import top.continew.admin.system.service.*;
import top.continew.starter.core.autoconfigure.project.ProjectProperties;
import top.continew.starter.core.util.validate.ValidationUtils;
import top.continew.starter.extension.crud.model.query.SortQuery;
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
Expand All @@ -60,7 +59,6 @@
@RequestMapping("/common")
public class CommonController {

private final ProjectProperties projectProperties;
private final FileService fileService;
private final DeptService deptService;
private final MenuService menuService;
Expand All @@ -71,8 +69,6 @@ public class CommonController {
@Operation(summary = "上传文件", description = "上传文件")
@PostMapping("/file")
public FileUploadResp upload(@NotNull(message = "文件不能为空") MultipartFile file) {
// TODO 实际开发时请删除本条校验
ValidationUtils.throwIf(projectProperties.isProduction(), "演示环境不支持上传文件");
ValidationUtils.throwIf(file::isEmpty, "文件不能为空");
FileInfo fileInfo = fileService.upload(file);
return FileUploadResp.builder().url(fileInfo.getUrl()).build();
Expand Down

0 comments on commit 8466105

Please sign in to comment.