mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-23 22:50:51 +08:00
feat: show unread message count
This commit is contained in:
@@ -45,4 +45,10 @@ public class NotificationService {
|
||||
}
|
||||
notificationRepository.saveAll(notifs);
|
||||
}
|
||||
|
||||
public long countUnread(String username) {
|
||||
User user = userRepository.findByUsername(username)
|
||||
.orElseThrow(() -> new IllegalArgumentException("User not found"));
|
||||
return notificationRepository.countByUserAndRead(user, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user