From 873edf0c23c74a34c6050dc8a3e4cbab07892a33 Mon Sep 17 00:00:00 2001 From: FhRh Date: Thu, 26 Sep 2024 16:53:45 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat=20:=20recipe=20=EC=97=94=ED=8B=B0?= =?UTF-8?q?=ED=8B=B0=20=EC=86=8D=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../banchango/recipe/domain/Recipe.java | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Server/banchango/src/main/java/com/sundaegukbap/banchango/recipe/domain/Recipe.java b/Server/banchango/src/main/java/com/sundaegukbap/banchango/recipe/domain/Recipe.java index 3ad10aa..94420da 100644 --- a/Server/banchango/src/main/java/com/sundaegukbap/banchango/recipe/domain/Recipe.java +++ b/Server/banchango/src/main/java/com/sundaegukbap/banchango/recipe/domain/Recipe.java @@ -1,20 +1,19 @@ package com.sundaegukbap.banchango.recipe.domain; -import com.sundaegukbap.banchango.bookmark.domain.RecipeBookmark; -import com.sundaegukbap.banchango.ingredient.domain.Ingredient; -import com.sundaegukbap.banchango.ingredient.domain.RecipeRequiringIngredient; -import com.sundaegukbap.banchango.user.domain.User; -import jakarta.persistence.*; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - @Entity @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) @@ -25,6 +24,7 @@ public class Recipe { private Long id; @NotNull private String name; + private String bestName; @NotNull @Column(length=2048) private String introduction; @@ -40,16 +40,24 @@ public class Recipe { @NotNull @Enumerated(EnumType.STRING) private Difficulty difficulty; + private String bySort; + private String byIngredient; + private String bySituation; @Builder - public Recipe(Long id, String name, String introduction, String image1, String link, int servings, int cookingTime, Difficulty difficulty) { + public Recipe(Long id, String name, String bestName, String introduction, String image1, String image2, String link, int servings, int cookingTime, Difficulty difficulty, String bySort, String byIngredient, String bySituation) { this.id = id; this.name = name; + this.bestName = bestName; this.introduction = introduction; this.image1 = image1; + this.image2 = image2; this.link = link; this.servings = servings; this.cookingTime = cookingTime; this.difficulty = difficulty; + this.bySort = bySort; + this.byIngredient = byIngredient; + this.bySituation = bySituation; } } From b625355a0feaad7888d6853529dda81edc69224a Mon Sep 17 00:00:00 2001 From: FhRh Date: Thu, 26 Sep 2024 16:53:59 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat=20:=20recipe=20=EC=A3=BC=EC=9E=AC?= =?UTF-8?q?=EB=A3=8C=20=EC=97=94=ED=8B=B0=ED=8B=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/RecipeMainIngredient.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Server/banchango/src/main/java/com/sundaegukbap/banchango/ingredient/domain/RecipeMainIngredient.java diff --git a/Server/banchango/src/main/java/com/sundaegukbap/banchango/ingredient/domain/RecipeMainIngredient.java b/Server/banchango/src/main/java/com/sundaegukbap/banchango/ingredient/domain/RecipeMainIngredient.java new file mode 100644 index 0000000..e03495f --- /dev/null +++ b/Server/banchango/src/main/java/com/sundaegukbap/banchango/ingredient/domain/RecipeMainIngredient.java @@ -0,0 +1,38 @@ +package com.sundaegukbap.banchango.ingredient.domain; + +import com.sundaegukbap.banchango.recipe.domain.Recipe; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Table(name="recipe_main_ingredients") +public class RecipeMainIngredient { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name="recipe_id") + private Recipe recipe; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name="ingredient_id") + private Ingredient ingredient; + + @Builder + public RecipeMainIngredient(Long id, Recipe recipe, Ingredient ingredient) { + this.id = id; + this.recipe = recipe; + this.ingredient = ingredient; + } +} From cc7e5f03473a20087fcb0d848b8cf002f56b2912 Mon Sep 17 00:00:00 2001 From: FhRh Date: Thu, 26 Sep 2024 19:28:38 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix=20:=20link=20=EC=86=8D=EC=84=B1?= =?UTF-8?q?=EC=9D=84=20=EC=97=86=EC=95=A0=EA=B3=A0=20id=EB=A5=BC=20?= =?UTF-8?q?=ED=86=B5=ED=95=B4=20url=EC=9D=84=20=EB=B0=98=ED=99=98=ED=95=9C?= =?UTF-8?q?=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/sundaegukbap/banchango/recipe/domain/Recipe.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Server/banchango/src/main/java/com/sundaegukbap/banchango/recipe/domain/Recipe.java b/Server/banchango/src/main/java/com/sundaegukbap/banchango/recipe/domain/Recipe.java index 94420da..d241048 100644 --- a/Server/banchango/src/main/java/com/sundaegukbap/banchango/recipe/domain/Recipe.java +++ b/Server/banchango/src/main/java/com/sundaegukbap/banchango/recipe/domain/Recipe.java @@ -32,8 +32,6 @@ public class Recipe { private String image1; private String image2; @NotNull - private String link; - @NotNull private int servings; @NotNull private int cookingTime; @@ -52,7 +50,6 @@ public Recipe(Long id, String name, String bestName, String introduction, String this.introduction = introduction; this.image1 = image1; this.image2 = image2; - this.link = link; this.servings = servings; this.cookingTime = cookingTime; this.difficulty = difficulty; @@ -60,4 +57,8 @@ public Recipe(Long id, String name, String bestName, String introduction, String this.byIngredient = byIngredient; this.bySituation = bySituation; } + + public String getLink(){ + return "https://m.10000recipe.com/recipe/"+this.id; + } }