guoshilong
2023-10-06 915735cd579637ee239f904874ba3f27b1ac2a18
src/main/java/com/dji/sample/component/oss/service/impl/AliyunOssServiceImpl.java
@@ -34,7 +34,7 @@
public class AliyunOssServiceImpl implements IOssService {
    private OSS ossClient;
    @Override
    public String getOssType() {
        return OssTypeEnum.ALIYUN.getType();
@@ -68,7 +68,7 @@
        // First check if the object can be fetched.
        boolean isExist = ossClient.doesObjectExist(bucket, objectKey);
        if (!isExist) {
            throw new OSSException("The object does not exist.");
            throw new OSSException("对象不存在");
        }
        return ossClient.generatePresignedUrl(bucket, objectKey,
@@ -92,7 +92,7 @@
    @Override
    public void putObject(String bucket, String objectKey, InputStream input) {
        if (ossClient.doesObjectExist(bucket, objectKey)) {
            throw new RuntimeException("The filename already exists.");
            throw new RuntimeException("文件已存在");
        }
        PutObjectResult objectResult = ossClient.putObject(new PutObjectRequest(bucket, objectKey, input, new ObjectMetadata()));
        log.info("Upload File: {}", objectResult.getETag());