11package com .example .FixLog .domain .post ;
22
33import com .example .FixLog .domain .bookmark .Bookmark ;
4+ import com .example .FixLog .domain .like .PostLike ;
45import com .example .FixLog .domain .member .Member ;
56import jakarta .persistence .*;
67import lombok .AccessLevel ;
@@ -70,9 +71,14 @@ public class Post {
7071 @ OneToMany (mappedBy = "postId" , cascade = CascadeType .ALL , orphanRemoval = true )
7172 private List <Bookmark > bookmarks = new ArrayList <>();
7273
74+ // 태그와의 관계
7375 @ OneToMany (mappedBy = "postId" , cascade = CascadeType .ALL , orphanRemoval = true )
7476 private List <PostTag > postTags = new ArrayList <>();
7577
78+ // 좋아요와의 관계
79+ @ OneToMany (mappedBy = "postId" , cascade = CascadeType .ALL , orphanRemoval = true )
80+ private List <PostLike > postLikes = new ArrayList <>();
81+
7682 public Post (Member userId , String postTitle , String coverImage , String problem , String errorMessage ,
7783 String environment , String reproduceCode , String solutionCode , String causeAnalysis ,
7884 String referenceLink , String extraContent , LocalDateTime createdAt , LocalDateTime editedAt ){
@@ -89,7 +95,6 @@ public Post(Member userId, String postTitle, String coverImage, String problem,
8995 this .extraContent = extraContent ;
9096 this .createdAt = createdAt ;
9197 this .editedAt = editedAt ;
92- // 게시글 이미지
9398 // 게시글 태그
9499 }
95100}
0 commit comments