Skip to content

Commit

Permalink
fix : Dto 타입변환으로 인한 메서드 호출 방식 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
seokjun01 committed Nov 7, 2024
1 parent df893d2 commit 6471c8d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public List<PostResponseDto> getLatestPosts() {
return posts.stream()
.map(PostResponseDto::from) // Post 객체를 PostResponseDto로 변환
.sorted(Comparator.comparingLong(postResponseDto ->
Math.abs(postResponseDto.getCreatedAt().until(now, java.time.temporal.ChronoUnit.SECONDS)))) // 현재 시각과의 차이를 기준으로 정렬
Math.abs(postResponseDto.createdAt().until(now, java.time.temporal.ChronoUnit.SECONDS)))) // 현재 시각과의 차이를 기준으로 정렬
.collect(Collectors.toList());
}

Expand Down

0 comments on commit 6471c8d

Please sign in to comment.