Revert "feat: add paginated notification APIs and frontend"

This reverts commit 7dd1f1b3d0.
This commit is contained in:
tim
2025-08-19 18:26:55 +08:00
parent fbca19791a
commit 1a12bec7b1
5 changed files with 209 additions and 313 deletions

View File

@@ -23,17 +23,9 @@ public class NotificationController {
private final NotificationMapper notificationMapper;
@GetMapping
public List<NotificationDto> list(@RequestParam(value = "page", defaultValue = "0") int page,
public List<NotificationDto> list(@RequestParam(value = "read", required = false) Boolean read,
Authentication auth) {
return notificationService.listNotifications(auth.getName(), null, page).stream()
.map(notificationMapper::toDto)
.collect(Collectors.toList());
}
@GetMapping("/unread")
public List<NotificationDto> listUnread(@RequestParam(value = "page", defaultValue = "0") int page,
Authentication auth) {
return notificationService.listNotifications(auth.getName(), false, page).stream()
return notificationService.listNotifications(auth.getName(), read).stream()
.map(notificationMapper::toDto)
.collect(Collectors.toList());
}