From c6fc1e804747247ae026d8c35a580401f960c887 Mon Sep 17 00:00:00 2001 From: xhaktmchl Date: Thu, 3 Nov 2022 17:55:34 +0900 Subject: [PATCH] =?UTF-8?q?#27=20feat:=20CommentRes=EC=97=90=20status,=20c?= =?UTF-8?q?reatedAt,=20updatedAt=20=ED=95=84=EB=93=9C=EA=B0=92=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/comment/CommentRes.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/yogit/server/board/dto/response/comment/CommentRes.java b/server/src/main/java/com/yogit/server/board/dto/response/comment/CommentRes.java index cb75e1e..5b6ff9c 100644 --- a/server/src/main/java/com/yogit/server/board/dto/response/comment/CommentRes.java +++ b/server/src/main/java/com/yogit/server/board/dto/response/comment/CommentRes.java @@ -2,6 +2,7 @@ import com.yogit.server.board.entity.ClipBoard; import com.yogit.server.board.entity.Comment; +import com.yogit.server.config.domain.BaseStatus; import com.yogit.server.user.entity.User; import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiParam; @@ -37,6 +38,18 @@ public class CommentRes { @ApiParam(value = "ClipBoard ID") private Long clipBoardId; + @ApiModelProperty(example = "ACTIVE") + @ApiParam(value = "객체 상태") + private BaseStatus status; + + @ApiModelProperty(example = "2022-07-13 16:29:30") + @ApiParam(value = "생성 시각") + private String createdAt; + + @ApiModelProperty(example = "2022-07-13 16:29:30") + @ApiParam(value = "마지막 업데이트 시각") + private String updatedAt; + public static CommentRes toDto(Comment comment){ return CommentRes.builder() .commentId(comment.getId()) @@ -45,16 +58,22 @@ public static CommentRes toDto(Comment comment){ .userName(comment.getUser().getName()) .profileImg(comment.getUser().getProfileImg()) .clipBoardId(comment.getClipBoard().getId()) + .status(comment.getStatus()) + .createdAt(comment.getCreatedAt()) + .updatedAt(comment.getUpdatedAt()) .build(); } @Builder - public CommentRes(Long commentId, String content, Long userId, String userName, String profileImg, Long clipBoardId) { + public CommentRes(Long commentId, String content, Long userId, String userName, String profileImg, Long clipBoardId, BaseStatus status, String createdAt, String updatedAt) { this.commentId = commentId; this.content = content; this.userId = userId; this.userName = userName; this.profileImg = profileImg; this.clipBoardId = clipBoardId; + this.status = status; + this.createdAt = createdAt; + this.updatedAt = updatedAt; } }