|
@@ -2,7 +2,7 @@ package com.kym.miniapp.controller;
|
|
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import com.kym.common.R;
|
|
import com.kym.common.R;
|
|
|
-import com.kym.common.annotation.SysLog;
|
|
|
|
|
|
|
+import com.kym.common.annotation.ApiLog;
|
|
|
import com.kym.common.utils.CommUtil;
|
|
import com.kym.common.utils.CommUtil;
|
|
|
import com.kym.entity.miniapp.Attachment;
|
|
import com.kym.entity.miniapp.Attachment;
|
|
|
import com.kym.service.miniapp.AttachmentService;
|
|
import com.kym.service.miniapp.AttachmentService;
|
|
@@ -31,7 +31,7 @@ public class FileController {
|
|
|
@PostMapping("/upload")
|
|
@PostMapping("/upload")
|
|
|
public R<?> upload(MultipartFile file) throws IOException {
|
|
public R<?> upload(MultipartFile file) throws IOException {
|
|
|
var fileName = file.getOriginalFilename();
|
|
var fileName = file.getOriginalFilename();
|
|
|
- CommUtil.asserts(!CommUtil.isExecutable(FileUtil.getSuffix(fileName)),"上传文件类型不支持");
|
|
|
|
|
|
|
+ CommUtil.asserts(!CommUtil.isExecutable(FileUtil.getSuffix(fileName)), "上传文件类型不支持");
|
|
|
Attachment attachment = attachmentService.upload(file);
|
|
Attachment attachment = attachmentService.upload(file);
|
|
|
return R.success(attachment);
|
|
return R.success(attachment);
|
|
|
}
|
|
}
|