Skip to content

Commit

Permalink
[FIX] createdDate 필드 날짜 타입으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaeAg committed Aug 7, 2024
1 parent ee426a8 commit 68a6e94
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.websoso.WSSServer.dto.comment;

import java.time.format.DateTimeFormatter;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDate;
import org.websoso.WSSServer.domain.Comment;
import org.websoso.WSSServer.dto.user.UserBasicInfo;

Expand All @@ -9,7 +10,8 @@ public record CommentGetResponse(
String nickname,
String avatarImage,
Long commentId,
String createdDate,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "M월 d일", timezone = "Asia/Seoul")
LocalDate createdDate,
String commentContent,
Boolean isModified,
Boolean isMyComment
Expand All @@ -20,7 +22,7 @@ public static CommentGetResponse of(UserBasicInfo userBasicInfo, Comment comment
userBasicInfo.nickname(),
userBasicInfo.avatarImage(),
comment.getCommentId(),
comment.getCreatedDate().format(DateTimeFormatter.ofPattern("M월 d일")),
comment.getCreatedDate().toLocalDate(),
comment.getCommentContent(),
!comment.getCreatedDate().equals(comment.getModifiedDate()),
isMyComment
Expand Down

0 comments on commit 68a6e94

Please sign in to comment.