BUGFIX:获取all pose的预览地址报错
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user