From e9ae5249ba53460475f356bb40212a1d541881d0 Mon Sep 17 00:00:00 2001 From: CHAE Date: Mon, 2 Oct 2023 15:54:50 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8Feat:=20=EC=9C=A0=EC=A0=80=20Entity?= =?UTF-8?q?=EC=99=80=20=EC=A6=90=EC=B0=BE=EC=9D=8C=EC=8B=9D,=20=ED=8C=94?= =?UTF-8?q?=EB=A1=9C=EC=9A=B0=EC=9C=A0=EC=A0=80=20=EC=97=B0=EA=B4=80?= =?UTF-8?q?=EA=B4=80=EA=B3=84=20=EC=84=A4=EC=A0=95=20(#7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/diareat/diareat/user/domain/User.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/diareat/diareat/user/domain/User.java b/src/main/java/com/diareat/diareat/user/domain/User.java index 8f4a99e..6753004 100644 --- a/src/main/java/com/diareat/diareat/user/domain/User.java +++ b/src/main/java/com/diareat/diareat/user/domain/User.java @@ -1,5 +1,6 @@ package com.diareat.diareat.user.domain; +import com.diareat.diareat.food.domain.FavoriteFood; import com.diareat.diareat.food.domain.Food; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AccessLevel; @@ -37,6 +38,12 @@ public class User { @OneToMany(mappedBy = "user", cascade = {CascadeType.PERSIST, CascadeType.REMOVE}) // 유저가 탈퇴하면 촬영한 음식도 삭제 private List foods = new ArrayList<>(); + @OneToMany(mappedBy = "user", cascade = {CascadeType.PERSIST, CascadeType.REMOVE}) // 유저가 탈퇴하면 즐겨찾기 음식도 삭제 + private List favoriteFoods = new ArrayList<>(); + + @OneToMany(mappedBy = "user") // 유저의 팔로우 목록 + private List followings = new ArrayList<>(); + // 생성 메서드 public static User createUser(String name, String keyCode, int height, int weight, int gender, int age, BaseNutrition baseNutrition) { User user = new User();