diff --git a/zlt-business/file-center/pom.xml b/zlt-business/file-center/pom.xml
index d7fefb8a..f86a25e6 100644
--- a/zlt-business/file-center/pom.xml
+++ b/zlt-business/file-center/pom.xml
@@ -79,13 +79,11 @@
com.github.tobato
fastdfs-client
-->
-
-
+
com.amazonaws
aws-java-sdk-s3
- -->
-
-
+
javax.xml.bind
diff --git a/zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java b/zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java
index 9b6a83f3..bdf610e0 100644
--- a/zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java
+++ b/zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java
@@ -4,6 +4,8 @@ import com.central.common.model.FileInfo;
import com.central.common.model.PageResult;
import com.central.common.model.Result;
import com.central.file.service.IFileService;
+import com.central.file.service.StorageHealthCheckService;
+import com.central.file.service.TimeWindowStorageService;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
@@ -34,6 +36,12 @@ public class FileController {
@Autowired
private IFileService fileService;
+ @Autowired
+ private TimeWindowStorageService timeWindowStorageService;
+
+ @Autowired
+ private StorageHealthCheckService storageHealthCheckService;
+
@Value("${zlt.security.tencent.accessTokenUrl}")
private String accessTokenUrl;
@@ -69,7 +77,7 @@ public class FileController {
@PostMapping(value = "/files-anon/file",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public String uploadFile(@RequestParam("file") MultipartFile file) throws Exception {
FileInfo fileInfo = fileService.upload(file);
- return fileService.getViewUrlByPath(fileInfo.getPath());
+ return timeWindowStorageService.getSmartViewUrlByPath(fileInfo.getPath());
}
/**
@@ -98,7 +106,7 @@ public class FileController {
PageResult pageResult = fileService.findList(params);
if(pageResult.getCount() >0){
for (FileInfo fileInfo: pageResult.getData()){
- fileInfo.setUrl(getViewUrlByPath(fileInfo.getName()));
+ fileInfo.setUrl(timeWindowStorageService.getSmartViewUrlByPath(fileInfo.getName()));
}
}
return pageResult;
@@ -107,24 +115,24 @@ public class FileController {
@GetMapping("/file/{id}")
public String getFileViewUrl(@PathVariable String id) {
log.info("请求文件可访问链接,参数文件Id:{}",id);
- String viewUrl = fileService.getViewUrl(id);
+ String viewUrl = timeWindowStorageService.getSmartViewUrl(id);
log.info("请求文件可访问链接,链接值:{}",viewUrl);
return viewUrl;
}
@GetMapping("/files/{id}")
public Result getViewUrl(@PathVariable String id) {
- return Result.succeed(fileService.getViewUrl(id),"获取成功");
+ return Result.succeed(timeWindowStorageService.getSmartViewUrl(id),"获取成功");
}
@GetMapping("/file/path")
public Result getFileViewUrlByPath(@RequestParam String path) {
- return Result.succeed(fileService.getViewUrlByPath(path),"获取成功");
+ return Result.succeed(timeWindowStorageService.getSmartViewUrlByPath(path),"获取成功");
}
@GetMapping("/files/path")
public String getViewUrlByPath(@RequestParam String path) {
- return fileService.getViewUrlByPath(path);
+ return timeWindowStorageService.getSmartViewUrlByPath(path);
}
@GetMapping("/files/path/style")
@@ -198,29 +206,41 @@ public class FileController {
HttpEntity