完善 yudao-spring-boot-starter-file 组件,支持 S3 对接云存储、local、ftp、sftp 等协议

This commit is contained in:
YunaiV
2022-03-14 22:09:41 +08:00
parent ed53ca3de9
commit 3d40fc81dd
15 changed files with 514 additions and 10 deletions

View File

@ -57,10 +57,15 @@ public class FileController {
return success(true);
}
@GetMapping("/get/{path}")
@GetMapping("/{configId}/get/{path}")
@ApiOperation("下载文件")
@ApiImplicitParam(name = "path", value = "文件附件", required = true, dataTypeClass = MultipartFile.class)
public void getFile(HttpServletResponse response, @PathVariable("path") String path) throws IOException {
@ApiImplicitParams({
@ApiImplicitParam(name = "configId", value = "配置编号", required = true, dataTypeClass = String.class),
@ApiImplicitParam(name = "path", value = "文件路径", required = true, dataTypeClass = String.class)
})
public void getFile(HttpServletResponse response,
@PathVariable("configId") String configId,
@PathVariable("path") String path) throws IOException {
FileDO file = fileService.getFile(path);
if (file == null) {
log.warn("[getFile][path({}) 文件不存在]", path);