diff --git a/src/main/java/com/example/aws/S3Manager.java b/src/main/java/com/example/aws/S3Manager.java index 3912ee2..46b78d0 100644 --- a/src/main/java/com/example/aws/S3Manager.java +++ b/src/main/java/com/example/aws/S3Manager.java @@ -17,6 +17,7 @@ @Component @RequiredArgsConstructor public class S3Manager { + private final AmazonS3 amazonS3; private final AmazonConfig awsConfig; private final UuidRepository uuidRepository; @@ -30,10 +31,10 @@ public String uploadFile(String keyName, MultipartFile file){ log.error("error at AmazonS3Manager uploadFile : {}", (Object) e.getStackTrace()); } - return amazonS3.getUrl(awsConfig.getBucket(), keyName).toString();} + return amazonS3.getUrl(awsConfig.getBucket(), keyName).toString(); + } public String generateReviewKeyName(Uuid uuid) { - - return awsConfig.getReviewPath() + '/' + uuid.getUuid(); + return awsConfig.getReviewPath() + "/" + uuid.getUuid(); } } diff --git a/src/main/java/com/example/config/AmazonConfig.java b/src/main/java/com/example/config/AmazonConfig.java index 0d912b5..55cc296 100644 --- a/src/main/java/com/example/config/AmazonConfig.java +++ b/src/main/java/com/example/config/AmazonConfig.java @@ -11,17 +11,18 @@ import org.springframework.beans.factory.annotation.Configurable; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; -@Configurable +@Configuration @Getter public class AmazonConfig { private AWSCredentials awsCredentials; - @Value("${cloud.aws.credentials.access-key}") + @Value("${cloud.aws.credentials.accessKey}") private String accessKey; - @Value("${cloud.aws.credentials.secret-key}") + @Value("${cloud.aws.credentials.secretKey}") private String secretKey; @Value("${cloud.aws.region.static}") @@ -34,21 +35,17 @@ public class AmazonConfig { private String reviewPath; @PostConstruct - public void init() { - this.awsCredentials = new BasicAWSCredentials(accessKey, secretKey); - } + public void init() { this.awsCredentials = new BasicAWSCredentials(accessKey, secretKey); } @Bean public AmazonS3 amazonS3() { - AWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretKey); - return AmazonS3ClientBuilder.standard() - .withRegion(region) - .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) - .build(); + AWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretKey); + return AmazonS3ClientBuilder.standard() + .withRegion(region) + .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) + .build(); } @Bean - public AWSCredentialsProvider awsCredentialsProvider() { - return new AWSStaticCredentialsProvider(awsCredentials); - } -} + public AWSCredentialsProvider awsCredentialsProvider() { return new AWSStaticCredentialsProvider(awsCredentials); } +} \ No newline at end of file diff --git a/src/main/java/com/example/repository/ReviewImageRepository.java b/src/main/java/com/example/repository/ReviewImageRepository.java deleted file mode 100644 index b728c3d..0000000 --- a/src/main/java/com/example/repository/ReviewImageRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.example.repository; - -import com.example.domain.mapping.ReviewImage; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface ReviewImageRepository extends JpaRepository { -} diff --git a/src/main/java/com/example/service/store/StoreCommandServiceImpl.java b/src/main/java/com/example/service/store/StoreCommandServiceImpl.java index 49cde95..215ca29 100644 --- a/src/main/java/com/example/service/store/StoreCommandServiceImpl.java +++ b/src/main/java/com/example/service/store/StoreCommandServiceImpl.java @@ -1,20 +1,8 @@ package com.example.service.store; -import com.example.aws.S3Manager; -import com.example.converter.ReviewConverter; -import com.example.domain.Review; -import com.example.domain.Uuid; -import com.example.repository.ReviewImageRepository; -import com.example.repository.ReviewRepository; -import com.example.repository.StoreRepository; -import com.example.repository.UuidRepository; -import com.example.service.member.MemberQueryService; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - -import java.util.UUID; @Service @RequiredArgsConstructor