From 6274dc4e151a0c75f1d73a3d6e2ad94a0b09f7e7 Mon Sep 17 00:00:00 2001 From: MinchoGreenT Date: Sun, 8 Sep 2024 19:02:43 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EC=8B=A0=EA=B3=A0=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=EC=97=90=20=EC=8B=A0=EA=B3=A0=20=EC=82=AC=EC=9C=A0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/farmclub/entity/MissionPostCommentReport.java | 6 +++++- .../domain/farmclub/entity/MissionPostReport.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/entity/MissionPostCommentReport.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/entity/MissionPostCommentReport.java index 1423d1c..49cdf33 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/entity/MissionPostCommentReport.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/entity/MissionPostCommentReport.java @@ -22,6 +22,9 @@ public class MissionPostCommentReport { @Column(name = "mission_post_comment_report_id") private Long id; + @Column(name = "reason") + private String reason; + @OnDelete(action = OnDeleteAction.CASCADE) @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "mission_post_comment_id") @@ -31,10 +34,11 @@ public class MissionPostCommentReport { @JoinColumn(name = "user_id") private User user; - public static MissionPostCommentReport createMissionPostCommentReport(MissionPostComment missionPostComment, User user){ + public static MissionPostCommentReport createMissionPostCommentReport(MissionPostComment missionPostComment, User user, String reason){ MissionPostCommentReport report = MissionPostCommentReport.builder() .missionPostComment(missionPostComment) .user(user) + .reason(reason) .build(); missionPostComment.addReport(report); diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/entity/MissionPostReport.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/entity/MissionPostReport.java index 3558ac1..e2a630b 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/entity/MissionPostReport.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/entity/MissionPostReport.java @@ -22,6 +22,9 @@ public class MissionPostReport { @Column(name = "mission_post_report_id") private Long id; + @Column(name = "reason") + private String reason; + @OnDelete(action = OnDeleteAction.CASCADE) @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "mission_post_id") @@ -31,10 +34,11 @@ public class MissionPostReport { @JoinColumn(name = "user_id") private User user; - public static MissionPostReport createMissionPostReport(MissionPost missionPost, User user){ + public static MissionPostReport createMissionPostReport(MissionPost missionPost, User user, String reason){ MissionPostReport report = MissionPostReport.builder() .missionPost(missionPost) .user(user) + .reason(reason) .build(); missionPost.addReport(report);