Skip to content
Snippets Groups Projects

feat(notification): [AOU-639] allow to filter notification to retrieve only unread notification

4 files
+ 28
5
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -90,7 +90,14 @@ public class NotificationController extends ResourceController<Notification> {
@GetMapping(SolidifyConstants.URL_SEP + AouActionName.INBOX)
@SuppressWarnings("squid:S4684")
public HttpEntity<Collection<Notification>> listInboxNotification(@ModelAttribute Notification search, Pageable pageable) {
final Page<Notification> listItem = ((NotificationService) (this.itemService)).listInboxNotification(this.userService.getCurrentUser(), search, null, null, pageable);
return listInboxNotification(false, search, pageable);
}
@UserPermissions
@GetMapping(path = SolidifyConstants.URL_SEP + AouActionName.INBOX, params = "onlyWithNullReadTime")
@SuppressWarnings("squid:S4684")
public HttpEntity<Collection<Notification>> listInboxNotification(@RequestParam boolean onlyWithNullReadTime, @ModelAttribute Notification search, Pageable pageable) {
final Page<Notification> listItem = ((NotificationService) (this.itemService)).listInboxNotification(this.userService.getCurrentUser(), search, null, null, onlyWithNullReadTime, pageable);
final Collection<Notification> collection = this.addRemainingLinks(listItem, pageable);
return new ResponseEntity<>(collection, HttpStatus.OK);
}
@@ -100,7 +107,7 @@ public class NotificationController extends ResourceController<Notification> {
public HttpEntity<Collection<Notification>> advancedSearch(@ModelAttribute Notification notification,
@RequestParam(value="structureId", required = false) String structureId,
@RequestParam(value = "researchGroupId", required = false) String researchGroupId, Pageable pageable) {
final Page<Notification> listItem = ((NotificationService) (this.itemService)).listInboxNotification(this.userService.getCurrentUser(), notification, structureId, researchGroupId, pageable);
final Page<Notification> listItem = ((NotificationService) (this.itemService)).listInboxNotification(this.userService.getCurrentUser(), notification, structureId, researchGroupId, false, pageable);
final Collection<Notification> collection = this.addRemainingLinks(listItem, pageable);
return new ResponseEntity<>(collection, HttpStatus.OK);
}
Loading