feat:修复获取订单素材bug
This commit is contained in:
+12
-12
@@ -710,28 +710,28 @@ public class OrderController {
|
|||||||
|
|
||||||
// aiVideo
|
// aiVideo
|
||||||
List<OrderFile> aiVideoFiles = allFiles.stream()
|
List<OrderFile> aiVideoFiles = allFiles.stream()
|
||||||
.filter(f -> "ai_video".equals(f.getFileTag()))
|
.filter(f -> "ai_video".equals(f.getFileTag()))
|
||||||
.toList();
|
.toList();
|
||||||
String aiVideoUrl = null;
|
String aiVideoUrl = null;
|
||||||
if (!aiVideoFiles.isEmpty()) {
|
if (!aiVideoFiles.isEmpty()) {
|
||||||
aiVideoUrl = fileCenterService.getViewUrlByPath(aiVideoFiles.get(0).getFilePath()).replace(cdnOssUrl, cdnUrl);
|
aiVideoUrl = fileCenterService.getFileViewUrl(aiVideoFiles.get(0).getFileId());
|
||||||
}
|
}
|
||||||
orderFileMap.put("aiVideo", aiVideoUrl);
|
orderFileMap.put("aiVideo", aiVideoUrl);
|
||||||
|
|
||||||
// 图片素材
|
// 图片素材
|
||||||
List<OrderFile> imgFiles = allFiles.stream()
|
List<OrderFile> imgFiles = allFiles.stream()
|
||||||
.filter(f -> "image/jpeg".equals(f.getFileType()))
|
.filter(f -> "image/jpeg".equals(f.getFileType()))
|
||||||
.toList();
|
.toList();
|
||||||
List<Map<String,String>> imgList = new ArrayList<>();
|
List<Map<String,String>> imgList = new ArrayList<>();
|
||||||
Map<String, String> fileMap = new HashMap<>();
|
Map<String, String> fileMap = new HashMap<>();
|
||||||
fileMap.put("style", fileStyle);
|
fileMap.put("style", fileStyle);
|
||||||
for (OrderFile orderFile : imgFiles){
|
for (OrderFile orderFile : imgFiles){
|
||||||
Map<String,String> imgMap = new HashMap<>();
|
Map<String,String> imgMap = new HashMap<>();
|
||||||
String url = fileCenterService.getViewUrlByPath(orderFile.getFilePath());
|
String url = fileCenterService.getFileViewUrl(orderFile.getFileId());
|
||||||
imgMap.put("url", url.replace(cdnOssUrl, cdnUrl));
|
imgMap.put("url", url);
|
||||||
imgMap.put("contentType", orderFile.getFileType());
|
imgMap.put("contentType", orderFile.getFileType());
|
||||||
imgMap.put("path", orderFile.getFilePath());
|
imgMap.put("path", orderFile.getFilePath());
|
||||||
fileMap.put("path",orderFile.getFilePath());
|
fileMap.put("fileId",orderFile.getFileId());
|
||||||
imgMap.put("viewUrl", fileCenterService.getViewUrlByPathStyle(fileMap));
|
imgMap.put("viewUrl", fileCenterService.getViewUrlByPathStyle(fileMap));
|
||||||
imgList.add(imgMap);
|
imgList.add(imgMap);
|
||||||
}
|
}
|
||||||
@@ -739,14 +739,14 @@ public class OrderController {
|
|||||||
|
|
||||||
// 视频素材
|
// 视频素材
|
||||||
List<OrderFile> videoFiles = allFiles.stream()
|
List<OrderFile> videoFiles = allFiles.stream()
|
||||||
.filter(f -> "raw_video".equals(f.getFileTag()))
|
.filter(f -> "raw_video".equals(f.getFileTag()))
|
||||||
.toList();
|
.toList();
|
||||||
List<Map<String,String>> videoList = new ArrayList<>();
|
List<Map<String,String>> videoList = new ArrayList<>();
|
||||||
for (int i = 0; i < videoFiles.size(); i++){
|
for (int i = 0; i < videoFiles.size(); i++){
|
||||||
OrderFile orderFile = videoFiles.get(i);
|
OrderFile orderFile = videoFiles.get(i);
|
||||||
Map<String,String> videoMap = new HashMap<>();
|
Map<String,String> videoMap = new HashMap<>();
|
||||||
String url = fileCenterService.getViewUrlByPath(orderFile.getFilePath());
|
String url = fileCenterService.getFileViewUrl(orderFile.getFileId());
|
||||||
videoMap.put("url", url.replace(cdnOssUrl, cdnUrl));
|
videoMap.put("url", url);
|
||||||
videoMap.put("contentType", orderFile.getFileType());
|
videoMap.put("contentType", orderFile.getFileType());
|
||||||
videoMap.put("path", orderFile.getFilePath());
|
videoMap.put("path", orderFile.getFilePath());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user