BUGFIX:获取all pose的预览地址报错

This commit is contained in:
2025-06-20 12:01:17 +08:00
parent 6b165fe5bc
commit 92278cf91b
2 changed files with 10 additions and 3 deletions

View File

@@ -63,7 +63,9 @@ public enum PoseEnum {
} }
public static List<Map<String, String>> getPropertyList() { public static List<Map<String, String>> getPropertyList() {
return new ArrayList<>(PROPERTY_LIST); // 返回副本以保证不可变性 return PROPERTY_LIST.stream()
.map(HashMap::new) // 深拷贝每个 Map
.collect(Collectors.toList());
} }
public static List<String> getVideoList() { public static List<String> getVideoList() {

View File

@@ -377,7 +377,8 @@ public class MinioUtil {
try { try {
String lowerName = fileName.toLowerCase(); String lowerName = fileName.toLowerCase();
boolean isImage = lowerName.endsWith(".jpg") || lowerName.endsWith(".jpeg") || lowerName.endsWith(".png"); boolean isImage = lowerName.endsWith(".jpg") || lowerName.endsWith(".jpeg")
|| lowerName.endsWith(".png") || lowerName.endsWith(".gif");
GetPresignedObjectUrlArgs.Builder builder = GetPresignedObjectUrlArgs.builder() GetPresignedObjectUrlArgs.Builder builder = GetPresignedObjectUrlArgs.builder()
.bucket(bucketName) .bucket(bucketName)
@@ -390,6 +391,8 @@ public class MinioUtil {
String contentType = "image/jpeg"; String contentType = "image/jpeg";
if (lowerName.endsWith(".png")) { if (lowerName.endsWith(".png")) {
contentType = "image/png"; contentType = "image/png";
} else if (lowerName.endsWith(".gif")) { // 新增 GIF
contentType = "image/gif";
} }
Map<String, String> queryParams = new HashMap<>(); Map<String, String> queryParams = new HashMap<>();
@@ -400,8 +403,10 @@ public class MinioUtil {
} }
return minioClient.getPresignedObjectUrl(builder.build()); return minioClient.getPresignedObjectUrl(builder.build());
} catch (MinioException | InvalidKeyException | IOException | NoSuchAlgorithmException e) { } catch (MinioException | InvalidKeyException
| IOException | NoSuchAlgorithmException | IllegalArgumentException e) {
e.printStackTrace(); e.printStackTrace();
log.error("bucket: {}, object:{}", bucketName, fileName);
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
} }
} }