Fix notification pagination after filtering disabled types

This commit is contained in:
Tim
2025-08-19 19:48:41 +08:00
parent 805a8df7d3
commit a3b28eafe4
3 changed files with 71 additions and 6 deletions

View File

@@ -17,7 +17,10 @@ public interface NotificationRepository extends JpaRepository<Notification, Long
List<Notification> findByUserAndReadOrderByCreatedAtDesc(User user, boolean read);
Page<Notification> findByUserOrderByCreatedAtDesc(User user, Pageable pageable);
Page<Notification> findByUserAndReadOrderByCreatedAtDesc(User user, boolean read, Pageable pageable);
Page<Notification> findByUserAndTypeNotInOrderByCreatedAtDesc(User user, java.util.Collection<NotificationType> types, Pageable pageable);
Page<Notification> findByUserAndReadAndTypeNotInOrderByCreatedAtDesc(User user, boolean read, java.util.Collection<NotificationType> types, Pageable pageable);
long countByUserAndRead(User user, boolean read);
long countByUserAndReadAndTypeNotIn(User user, boolean read, java.util.Collection<NotificationType> types);
List<Notification> findByPost(Post post);
List<Notification> findByComment(Comment comment);