From f717e0dc163d0cd0a5cddf207fb05f8782c7d9d4 Mon Sep 17 00:00:00 2001 From: mincheol Date: Sun, 22 Dec 2024 13:46:04 +0900 Subject: [PATCH] =?UTF-8?q?[=EA=B9=80=EB=AF=BC=EC=B2=A0]=20recipeSourceurl?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/vcs.xml | 6 ++++++ .../moja/refrigerator/service/recipe/RecipeServiceImpl.java | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/refrigerator/src/main/java/moja/refrigerator/service/recipe/RecipeServiceImpl.java b/refrigerator/src/main/java/moja/refrigerator/service/recipe/RecipeServiceImpl.java index 671926d..d3acd3f 100644 --- a/refrigerator/src/main/java/moja/refrigerator/service/recipe/RecipeServiceImpl.java +++ b/refrigerator/src/main/java/moja/refrigerator/service/recipe/RecipeServiceImpl.java @@ -50,6 +50,8 @@ public class RecipeServiceImpl implements RecipeService { @Value("${cloud.aws.s3.bucket}") private String bucket; + @Value("${cloud.aws.region.static}") + private String region; @Autowired public RecipeServiceImpl( @@ -104,7 +106,7 @@ private RecipeSource RecipeSourceSaveFile(MultipartFile file, Recipe recipe, Str // 파일 이름 생성 및 저장 경로 설정 UUID uuid = UUID.randomUUID(); String serverFileName = uuid + "_" + originalFileName; - String fileUrl = "https://" + bucket + "/" + pathPrefix + serverFileName; + String fileUrl = "https://" + bucket + ".s3."+region+".amazonaws.com/" + pathPrefix + serverFileName; // RecipeSource 생성 및 설정 RecipeSource recipeSource = new RecipeSource(); @@ -154,7 +156,7 @@ private RecipeStepSource RecipeStepSourceSaveFile(MultipartFile file, RecipeStep // 파일 이름 생성 및 저장 경로 설정 UUID uuid = UUID.randomUUID(); String serverFileName = uuid + "_" + originalFileName; - String fileUrl = "https://" + bucket + "/" + pathPrefix + serverFileName; + String fileUrl = "https://" + bucket +".s3."+region+".amazonaws.com/"+ pathPrefix + serverFileName; // RecipeSource 생성 및 설정 RecipeStepSource recipeSource = new RecipeStepSource();