Skip to content

Commit

Permalink
Refact : response에서 createDate 포맷 설정 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen-ing committed Jan 24, 2025
1 parent 7b90012 commit 7ef0584
Showing 1 changed file with 3 additions and 3 deletions.
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()));
}
}

0 comments on commit 7ef0584

Please sign in to comment.