|
@@ -3,6 +3,7 @@ package com.css.simulation.resource.scene.ctrl;
|
|
|
import api.common.pojo.common.ResponseBodyVO;
|
|
|
import api.common.pojo.constants.DictConstants;
|
|
|
import api.common.pojo.param.MinioParameter;
|
|
|
+import api.common.pojo.param.RedisParameter;
|
|
|
import api.common.util.TimeUtil;
|
|
|
import com.css.simulation.resource.feign.FileDownService;
|
|
|
import feign.Response;
|
|
@@ -53,11 +54,12 @@ public class FileController {
|
|
|
fileName = multipartFile.getOriginalFilename();
|
|
|
}
|
|
|
ResponseBodyVO<String> respon;
|
|
|
- if (type.equals(DictConstants.ALGORITHM_FILE)) {
|
|
|
- respon = fileDownService.uploadProcessBar(multipartFile, fileName, objectPath);
|
|
|
- }else {
|
|
|
- respon = fileDownService.upload(multipartFile, fileName);
|
|
|
- }
|
|
|
+// if (type.equals(DictConstants.ALGORITHM_FILE)) {
|
|
|
+// respon = fileDownService.uploadProcessBar(multipartFile, fileName, objectPath);
|
|
|
+// }else {
|
|
|
+// respon = fileDownService.upload(multipartFile, fileName);
|
|
|
+// }
|
|
|
+ respon = fileDownService.upload(multipartFile, fileName);
|
|
|
String videoPreview = respon.getMessage();
|
|
|
Map map = new HashMap();
|
|
|
// map.put("videoPreview", videoPreview);
|
|
@@ -78,6 +80,15 @@ public class FileController {
|
|
|
downloadForHttp(parms.getObjectName(), inputStream, response, 1024);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping(value = "/getProgress")
|
|
|
+ public ResponseBodyVO getProgress(@RequestParam("objectPath") String objectPath){
|
|
|
+ RedisParameter redisParameter = new RedisParameter();
|
|
|
+ redisParameter.setKey(objectPath);
|
|
|
+ ResponseBodyVO resp = fileDownService.getProgress(redisParameter);
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
public void downloadForHttp(String fileName, InputStream in, HttpServletResponse response, int bufferSize) throws IOException {
|
|
|
int idx = fileName.lastIndexOf("/");
|