oying-tools/src/main/java/com/oying/utils/ObsUtils.java
@@ -124,4 +124,15 @@
        // 删除指定的对象
        obsClient.deleteObject(properties.getBucket(), objectKey);
    }
    public static String getPublicObjectUrl(ObsProperties properties, String objectKey) {
        return getPublicObjectUrl(properties.getBucket(), properties.getEndpoint(), objectKey);
    }
    public static String getPublicObjectUrl(String bucketName, String endpoint, String objectKey) {
        // 移除objectKey开头可能存在的文件分割符('/')
        String cleanObjectKey = objectKey.startsWith("/") ? objectKey.substring(1) : objectKey;
        // 标准URL格式
        return String.format("https://%s.%s/%s", bucketName, endpoint.replaceAll("^https?://", ""), cleanObjectKey);
    }
}