From 3fe1d6e3030ee250ff6ae1373ed463126f24a4ea Mon Sep 17 00:00:00 2001 From: hanueleee Date: Thu, 19 Oct 2023 21:56:51 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=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=EC=8B=9C=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/funeat/product/domain/Product.java | 12 +----------- 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, 1 insertion(+), 20 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..1272c2c9 100644 --- a/backend/src/main/java/com/funeat/product/domain/Product.java +++ b/backend/src/main/java/com/funeat/product/domain/Product.java @@ -41,12 +41,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 +109,7 @@ public Double calculateRankingScore(final Long reviewCount) { } public void updateBasicImage() { - if (category.isFood()) { - this.image = basicFoodImage; - return; - } - this.image = basicStoreImage; + this.image = null; } 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 } From 881a730e36cb1ef9e3f3ff2a44a987e7733e16fd Mon Sep 17 00:00:00 2001 From: hanueleee Date: Thu, 19 Oct 2023 22:00:22 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=EC=83=81=EC=88=98=20=EC=B6=94?= =?UTF-8?q?=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/com/funeat/product/domain/Product.java | 5 +++-- 1 file changed, 3 insertions(+), 2 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 1272c2c9..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; @@ -109,7 +110,7 @@ public Double calculateRankingScore(final Long reviewCount) { } public void updateBasicImage() { - this.image = null; + this.image = BASIC_IMAGE; } public void updateFavoriteImage(final String topFavoriteImage) {