From ebffbe92ad9de3149e7b3ccbb5053127c36136e2 Mon Sep 17 00:00:00 2001 From: larama-C Date: Sun, 15 Mar 2026 11:22:12 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=8C=93=EA=B8=80=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EB=B0=98=ED=99=98=20DTO=EC=97=90=20=ED=8F=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20ID=EC=99=80=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/comment/dto/response/CommentResponse.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/back/web7_9_codecrete_be/domain/community/comment/dto/response/CommentResponse.java b/src/main/java/com/back/web7_9_codecrete_be/domain/community/comment/dto/response/CommentResponse.java index 4b0fddf7..80d0b934 100644 --- a/src/main/java/com/back/web7_9_codecrete_be/domain/community/comment/dto/response/CommentResponse.java +++ b/src/main/java/com/back/web7_9_codecrete_be/domain/community/comment/dto/response/CommentResponse.java @@ -1,6 +1,7 @@ package com.back.web7_9_codecrete_be.domain.community.comment.dto.response; import com.back.web7_9_codecrete_be.domain.community.comment.entity.Comment; +import com.back.web7_9_codecrete_be.domain.community.post.entity.PostCategory; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Getter; @@ -18,6 +19,12 @@ public class CommentResponse { @Schema(description = "작성자 사용자 ID", example = "12") private Long userId; + @Schema(description = "포스트 ID", example = "3") + private Long postId; + + @Schema(description = "포스트 카테고리", example = "JOIN") + private PostCategory postCategory; + @Schema(description = "댓글 내용", example = "정말 공감합니다!") private String content; @@ -34,6 +41,8 @@ public static CommentResponse from(Comment comment) { return CommentResponse.builder() .commentId(comment.getCommentId()) .userId(comment.getUserId()) + .postId(comment.getPost().getPostId()) + .postCategory(comment.getPost().getCategory()) .content(comment.getContent()) .createdDate(comment.getCreatedDate()) .modifiedDate(comment.getModifiedDate())