From 4f9469c8d0bc17c01c4351eaa5a611da09817bb7 Mon Sep 17 00:00:00 2001 From: Hanuel Lee <91522259+hanueleee@users.noreply.github.com> Date: Thu, 19 Oct 2023 22:03:13 +0900 Subject: [PATCH] =?UTF-8?q?[BE]=20hotfix:=20=EA=B8=B0=EB=B3=B8=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=EB=A1=9C=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=EB=A1=9C=EC=A7=81=EC=97=90=20=ED=99=98=EA=B2=BD?= =?UTF-8?q?=EB=B3=80=EC=88=98=20=EC=A0=9C=EA=B1=B0=20(#830)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 기본 이미지로 업데이트시 null * refactor: 상수 추출 --- .../java/com/funeat/product/domain/Product.java | 15 +++------------ backend/src/main/resources/application-dev.yml | 3 --- backend/src/main/resources/application-local.yml | 3 --- backend/src/main/resources/application-prod.yml | 3 --- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/backend/src/main/java/com/funeat/product/domain/Product.java b/backend/src/main/java/com/funeat/product/domain/Product.java index 818217d3..a95a7b91 100644 --- a/backend/src/main/java/com/funeat/product/domain/Product.java +++ b/backend/src/main/java/com/funeat/product/domain/Product.java @@ -10,11 +10,12 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; -import org.springframework.beans.factory.annotation.Value; @Entity public class Product { + public static final String BASIC_IMAGE = null; + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @@ -41,12 +42,6 @@ public class Product { @OneToMany(mappedBy = "product") private List productRecipes; - @Value("${cloud.aws.image.food}") - private String basicFoodImage; - - @Value("${cloud.aws.image.store}") - private String basicStoreImage; - protected Product() { } @@ -115,11 +110,7 @@ public Double calculateRankingScore(final Long reviewCount) { } public void updateBasicImage() { - if (category.isFood()) { - this.image = basicFoodImage; - return; - } - this.image = basicStoreImage; + this.image = BASIC_IMAGE; } public void updateFavoriteImage(final String topFavoriteImage) { diff --git a/backend/src/main/resources/application-dev.yml b/backend/src/main/resources/application-dev.yml index 2eafb552..0c1a7222 100644 --- a/backend/src/main/resources/application-dev.yml +++ b/backend/src/main/resources/application-dev.yml @@ -44,6 +44,3 @@ cloud: bucket: { S3_BUCKET } folder: { S3_DEV_FOLDER } cloudfrontPath: { S3_DEV_CLOUDFRONT_PATH } - image: - food: { DEV_BASIC_FOOD_IMAGE } - store: { DEV_BASIC_STORE_IMAGE } diff --git a/backend/src/main/resources/application-local.yml b/backend/src/main/resources/application-local.yml index 3bab01cf..27ba9bcc 100644 --- a/backend/src/main/resources/application-local.yml +++ b/backend/src/main/resources/application-local.yml @@ -29,6 +29,3 @@ cloud: bucket: { S3_BUCKET } folder: { S3_LOCAL_FOLDER } cloudfrontPath: { S3_LOCAL_CLOUDFRONT_PATH } - image: - food: { LOCAL_BASIC_FOOD_IMAGE } - store: { LOCAL_BASIC_STORE_IMAGE } diff --git a/backend/src/main/resources/application-prod.yml b/backend/src/main/resources/application-prod.yml index 339749bf..1943e2bf 100644 --- a/backend/src/main/resources/application-prod.yml +++ b/backend/src/main/resources/application-prod.yml @@ -43,6 +43,3 @@ cloud: bucket: { S3_BUCKET } folder: { S3_PROD_FOLDER } cloudfrontPath: { S3_PROD_CLOUDFRONT_PATH } - image: - food: { PROD_BASIC_FOOD_IMAGE } - store: { PROD_BASIC_STORE_IMAGE }