Skip to content

Commit

Permalink
[fix] 신고 테이블에 신고 사유 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
MinchoGreenT committed Sep 8, 2024
1 parent 62cf213 commit 6274dc4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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);
Expand Down

0 comments on commit 6274dc4

Please sign in to comment.