Feat: CommentResponse 구체적인 반환 추가 - S11P21S002-156

This commit is contained in:
kimtaesoo7 2024-09-09 16:28:49 +09:00
parent b536fa4442
commit b59c372947

View File

@ -18,6 +18,12 @@ public class CommentResponse {
@Schema(description = "작성자 ID", example = "1") @Schema(description = "작성자 ID", example = "1")
private Integer memberId; private Integer memberId;
@Schema(description = "작성자 닉네임", example = "javajoha")
private String memberNickname;
@Schema(description = "작성자 프로필", example = "profile.jpg")
private String memberProfileImage;
@Schema(description = "y좌표", example = "3.16324") @Schema(description = "y좌표", example = "3.16324")
private double positionY; private double positionY;
@ -27,12 +33,14 @@ public class CommentResponse {
@Schema(description = "댓글 내용", example = "이 부분 더 자세하게 표현해주세요") @Schema(description = "댓글 내용", example = "이 부분 더 자세하게 표현해주세요")
private String content; private String content;
@Schema(description = "작성 일자", example = "2024.09.09 / 15:00") @Schema(description = "작성 일자", example = "2024-09-09T14:47:45")
private LocalDateTime createTime; private LocalDateTime createTime;
public static CommentResponse from(final Comment comment) { public static CommentResponse from(final Comment comment) {
return new CommentResponse(comment.getId(), return new CommentResponse(comment.getId(),
comment.getMember().getId(), comment.getMember().getId(),
comment.getMember().getNickname(),
comment.getMember().getProfileImage(),
comment.getPositionY(), comment.getPositionY(),
comment.getPositionX(), comment.getPositionX(),
comment.getContent(), comment.getContent(),