diff --git a/src/main/java/com/softeer/backend/fo_domain/comment/repository/CommentRepository.java b/src/main/java/com/softeer/backend/fo_domain/comment/repository/CommentRepository.java index 1c69741d..941c7334 100644 --- a/src/main/java/com/softeer/backend/fo_domain/comment/repository/CommentRepository.java +++ b/src/main/java/com/softeer/backend/fo_domain/comment/repository/CommentRepository.java @@ -12,5 +12,5 @@ @Repository public interface CommentRepository extends JpaRepository { - Page findAllByIdLessThanEqualOrderByIdDesc(Integer id, Pageable pageable); + Page findAllByIdLessThanOrderByIdDesc(Integer id, Pageable pageable); } diff --git a/src/main/java/com/softeer/backend/fo_domain/comment/service/CommentService.java b/src/main/java/com/softeer/backend/fo_domain/comment/service/CommentService.java index c7bd7eb5..d97674e5 100644 --- a/src/main/java/com/softeer/backend/fo_domain/comment/service/CommentService.java +++ b/src/main/java/com/softeer/backend/fo_domain/comment/service/CommentService.java @@ -32,7 +32,7 @@ public class CommentService { public CommentsResponseDto getComments(Integer userId, Integer cursor) { PageRequest pageRequest = PageRequest.of(0, SCROLL_SIZE + 1); - Page page = commentRepository.findAllByIdLessThanEqualOrderByIdDesc(cursor, pageRequest); + Page page = commentRepository.findAllByIdLessThanOrderByIdDesc(cursor, pageRequest); List comments = page.getContent(); diff --git a/src/main/java/com/softeer/backend/fo_domain/comment/util/ScrollPaginationUtil.java b/src/main/java/com/softeer/backend/fo_domain/comment/util/ScrollPaginationUtil.java index 01ca3845..9459d091 100644 --- a/src/main/java/com/softeer/backend/fo_domain/comment/util/ScrollPaginationUtil.java +++ b/src/main/java/com/softeer/backend/fo_domain/comment/util/ScrollPaginationUtil.java @@ -44,7 +44,6 @@ public List getCurrentScrollItems() { } else { itemsList = new ArrayList<>(itemsWithNextCursor.subList(0, countPerScroll)); } - Collections.reverse(itemsList); return itemsList; } diff --git a/src/main/java/com/softeer/backend/fo_domain/fcfs/service/FcfsService.java b/src/main/java/com/softeer/backend/fo_domain/fcfs/service/FcfsService.java index c11f228d..b8b8f610 100644 --- a/src/main/java/com/softeer/backend/fo_domain/fcfs/service/FcfsService.java +++ b/src/main/java/com/softeer/backend/fo_domain/fcfs/service/FcfsService.java @@ -23,14 +23,11 @@ import org.springframework.stereotype.Service; import java.time.LocalDate; -import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; import java.util.Map; -import static java.util.stream.Collectors.toList; - /** * 선착순 관련 이벤트를 처리하는 클래스 */