From 07b2ea9a15a31be1bffb8da116a60fb91e043261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=9A=A9=EC=88=98?= Date: Thu, 19 Sep 2024 12:17:09 +0900 Subject: [PATCH] =?UTF-8?q?Refactor:=20Comment=20=EC=9D=91=EB=8B=B5?= =?UTF-8?q?=ED=98=95=EC=8B=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/entity/dto/CommentResponse.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/backend/src/main/java/com/worlabel/domain/comment/entity/dto/CommentResponse.java b/backend/src/main/java/com/worlabel/domain/comment/entity/dto/CommentResponse.java index 1ca243d..ef0c9da 100644 --- a/backend/src/main/java/com/worlabel/domain/comment/entity/dto/CommentResponse.java +++ b/backend/src/main/java/com/worlabel/domain/comment/entity/dto/CommentResponse.java @@ -1,6 +1,7 @@ package com.worlabel.domain.comment.entity.dto; import com.worlabel.domain.comment.entity.Comment; +import com.worlabel.domain.member.entity.dto.MemberResponse; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Getter; @@ -15,14 +16,8 @@ public class CommentResponse { @Schema(description = "댓글 ID", example = "1") private Integer id; - @Schema(description = "작성자 ID", example = "1") - private Integer memberId; - - @Schema(description = "작성자 닉네임", example = "javajoha") - private String memberNickname; - - @Schema(description = "작성자 프로필", example = "profile.jpg") - private String memberProfileImage; + @Schema(description = "작성자", example = "") + private MemberResponse author; @Schema(description = "y좌표", example = "3.16324") private double positionY; @@ -38,9 +33,7 @@ public class CommentResponse { public static CommentResponse from(final Comment comment) { return new CommentResponse(comment.getId(), - comment.getMember().getId(), - comment.getMember().getNickname(), - comment.getMember().getProfileImage(), + MemberResponse.of(comment.getMember()), comment.getPositionY(), comment.getPositionX(), comment.getContent(),