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);