-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refact : response에서 createDate 포맷 설정 (#25)
- Loading branch information
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
src/main/java/com/ripple/BE/post/dto/response/LikeCommentResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
package com.ripple.BE.post.dto.response; | ||
|
||
import com.ripple.BE.global.utils.RelativeTimeFormatter; | ||
import com.ripple.BE.post.domain.type.PostType; | ||
import com.ripple.BE.post.dto.LikeCommentDTO; | ||
import java.time.LocalDateTime; | ||
|
||
public record LikeCommentResponse( | ||
Long id, String content, String postName, PostType type, LocalDateTime createdDate) { | ||
Long id, String content, String postName, PostType type, String createdDate) { | ||
public static LikeCommentResponse toLikeCommentResponse(LikeCommentDTO likeCommentDTO) { | ||
return new LikeCommentResponse( | ||
likeCommentDTO.id(), | ||
likeCommentDTO.content(), | ||
likeCommentDTO.postName(), | ||
likeCommentDTO.type(), | ||
likeCommentDTO.createdDate()); | ||
RelativeTimeFormatter.formatRelativeTime(likeCommentDTO.createdDate())); | ||
} | ||
} |