Skip to content

Commit

Permalink
[refactor] @value로 수정(#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbbin committed Aug 7, 2024
1 parent 12dc4bc commit f8661b6
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.recordy.server.user.domain.User;
import org.recordy.server.user.exception.UserException;
import org.recordy.server.user.repository.UserRepository;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Slice;
import org.springframework.stereotype.Service;
Expand All @@ -37,6 +38,12 @@ public class RecordServiceImpl implements RecordService {
private final BookmarkRepository bookmarkRepository;
private final UserRepository userRepository;

@Value("${aws-property.cloudfront-domain-name}")
private String cloudFrontDomain;

@Value("${aws-property.s3-domain}")
private String s3Domain;

@Override
public Record create(RecordCreate recordCreate) {
User user = userRepository.findById(recordCreate.uploaderId())
Expand All @@ -55,9 +62,6 @@ public Record create(RecordCreate recordCreate) {


private FileUrl convertToCloudFrontUrl(FileUrl fileUrl) {
String cloudFrontDomain = "d2p19guzt9trnp.cloudfront.net";
String s3Domain = "recordy-bucket.s3.ap-northeast-2.amazonaws.com";

String cloudFrontVideoUrl = fileUrl.videoUrl().replace(s3Domain, cloudFrontDomain);
String cloudFrontThumbnailUrl = fileUrl.thumbnailUrl().replace(s3Domain, cloudFrontDomain);

Expand Down

0 comments on commit f8661b6

Please sign in to comment.