refactor: 上传文件后返回id及缩略图 (#137)

Closes #132
This commit is contained in:
luoqiz
2025-03-06 13:39:15 +08:00
committed by GitHub
parent 9b53e6dc58
commit d83fd0d5cb
4 changed files with 31 additions and 1 deletions

View File

@@ -69,7 +69,12 @@ public class CommonController {
public FileUploadResp upload(@NotNull(message = "文件不能为空") MultipartFile file) {
ValidationUtils.throwIf(file::isEmpty, "文件不能为空");
FileInfo fileInfo = fileService.upload(file);
return FileUploadResp.builder().url(fileInfo.getUrl()).build();
return FileUploadResp.builder()
.id(fileInfo.getId())
.url(fileInfo.getUrl())
.thUrl(fileInfo.getThUrl())
.metadata(fileInfo.getMetadata())
.build();
}
@Operation(summary = "查询部门树", description = "查询树结构的部门列表")