File tree Expand file tree Collapse file tree
src/main/java/com/back/web7_9_codecrete_be/domain/community/comment/dto/response Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .back .web7_9_codecrete_be .domain .community .comment .dto .response ;
22
33import com .back .web7_9_codecrete_be .domain .community .comment .entity .Comment ;
4+ import com .back .web7_9_codecrete_be .domain .community .post .entity .PostCategory ;
45import io .swagger .v3 .oas .annotations .media .Schema ;
56import lombok .Builder ;
67import lombok .Getter ;
@@ -18,6 +19,12 @@ public class CommentResponse {
1819 @ Schema (description = "작성자 사용자 ID" , example = "12" )
1920 private Long userId ;
2021
22+ @ Schema (description = "포스트 ID" , example = "3" )
23+ private Long postId ;
24+
25+ @ Schema (description = "포스트 카테고리" , example = "JOIN" )
26+ private PostCategory postCategory ;
27+
2128 @ Schema (description = "댓글 내용" , example = "정말 공감합니다!" )
2229 private String content ;
2330
@@ -34,6 +41,8 @@ public static CommentResponse from(Comment comment) {
3441 return CommentResponse .builder ()
3542 .commentId (comment .getCommentId ())
3643 .userId (comment .getUserId ())
44+ .postId (comment .getPost ().getPostId ())
45+ .postCategory (comment .getPost ().getCategory ())
3746 .content (comment .getContent ())
3847 .createdDate (comment .getCreatedDate ())
3948 .modifiedDate (comment .getModifiedDate ())
You can’t perform that action at this time.
0 commit comments