|
|
@@ -28,12 +28,12 @@ public class FileController extends IController {
|
|
|
@Resource
|
|
|
private AttachmentService attachmentService;
|
|
|
|
|
|
- @ApiLog("文件上传")
|
|
|
+ @ApiLog(value = "文件上传", ignoreParams = true)
|
|
|
@PostMapping("/upload")
|
|
|
- public R<?> upload(MultipartFile file) {
|
|
|
+ public R<?> upload(MultipartFile file) {
|
|
|
var fileName = file.getOriginalFilename();
|
|
|
- CommUtil.asserts(!CommUtil.isExecutable(FileUtil.getSuffix(fileName)),"上传文件类型不支持");
|
|
|
- return resp(()-> {
|
|
|
+ CommUtil.asserts(!CommUtil.isExecutable(FileUtil.getSuffix(fileName)), "上传文件类型不支持");
|
|
|
+ return resp(() -> {
|
|
|
try {
|
|
|
return attachmentService.upload(file);
|
|
|
} catch (IOException e) {
|
|
|
@@ -43,12 +43,11 @@ public class FileController extends IController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@ApiLog("文件删除")
|
|
|
@PostMapping("/delete/{fileId}")
|
|
|
- public R<?> delete(@PathVariable String fileId){
|
|
|
- CommUtil.asserts(!CommUtil.isEmptyOrNull(fileId),"删除文件不能为空");
|
|
|
- return resp((t)->attachmentService.delete(fileId));
|
|
|
+ public R<?> delete(@PathVariable String fileId) {
|
|
|
+ CommUtil.asserts(!CommUtil.isEmptyOrNull(fileId), "删除文件不能为空");
|
|
|
+ return resp((t) -> attachmentService.delete(fileId));
|
|
|
}
|
|
|
|
|
|
}
|