Skip to content

Commit

Permalink
Fix: 채팅 개수 10개로 조정
Browse files Browse the repository at this point in the history
  • Loading branch information
nonaninona committed Feb 17, 2024
1 parent 1ac3003 commit d435254
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public interface ChatRepository extends JpaRepository<Chat, Long> {

List<Chat> findTop10ByMember_UserIdOrderByChatIdDesc(Long userId);
@Query("SELECT c FROM chat c WHERE c.member.userId = :userId AND :lastChatId-10 < c.chatId AND c.chatId < :lastChatId ORDER BY c.chatId ASC")
@Query("SELECT c FROM chat c WHERE c.member.userId = :userId AND :lastChatId-10 < c.chatId AND c.chatId <= :lastChatId ORDER BY c.chatId ASC")
List<Chat> findTop10ByUserIdAndChatIdLessThanOrderByChatIdDesc(@Param("userId") Long userId, @Param("lastChatId") Long lastChatId);
List<Chat> findTopByMember_UserIdOrderByChatIdDesc(Long userId);
}

0 comments on commit d435254

Please sign in to comment.