|
@@ -25,6 +25,8 @@ import javax.annotation.security.PermitAll;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
|
|
+import java.time.ZonedDateTime;
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
@@ -57,6 +59,16 @@ public class FileController {
|
|
|
return success(fileService.createFile(file.getOriginalFilename(), path, IoUtil.readBytes(file.getInputStream())));
|
|
return success(fileService.createFile(file.getOriginalFilename(), path, IoUtil.readBytes(file.getInputStream())));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("/upload/qhse/path")
|
|
|
|
|
+ @Operation(summary = "上传文件", description = "模式一:后端上传文件")
|
|
|
|
|
+ public CommonResult<String> uploadQhseFilePath(FileUploadReqVO uploadReqVO) throws Exception {
|
|
|
|
|
+ MultipartFile file = uploadReqVO.getFile();
|
|
|
|
|
+ String path = uploadReqVO.getPath();
|
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
|
|
|
|
+ String format = ZonedDateTime.now().format(formatter);
|
|
|
|
|
+ return success(fileService.createFile(format + file.getOriginalFilename(), path, IoUtil.readBytes(file.getInputStream())));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@GetMapping("/presigned-url")
|
|
@GetMapping("/presigned-url")
|
|
|
@Operation(summary = "获取文件预签名地址", description = "模式二:前端上传文件:用于前端直接上传七牛、阿里云 OSS 等文件存储器")
|
|
@Operation(summary = "获取文件预签名地址", description = "模式二:前端上传文件:用于前端直接上传七牛、阿里云 OSS 等文件存储器")
|
|
|
public CommonResult<FilePresignedUrlRespVO> getFilePresignedUrl(@RequestParam("path") String path) throws Exception {
|
|
public CommonResult<FilePresignedUrlRespVO> getFilePresignedUrl(@RequestParam("path") String path) throws Exception {
|