NotificationController

@RestController
@RequestMapping(value = ["/api/v1/notifications"])
class NotificationController(notificationService: NotificationService)

Constructors

Link copied to clipboard
constructor(notificationService: NotificationService)

Functions

Link copied to clipboard
@GetMapping
fun getNotifications(@AuthenticationPrincipal userDetails: UserDetails, pageable: Pageable): ResponseEntity<PagedModel<Notification>>
Link copied to clipboard
@GetMapping(path = ["/subscribe"], produces = ["text/event-stream"])
fun notificationSubscribe(principal: Principal): SseEmitter
Link copied to clipboard
@PostMapping
@PreAuthorize(value = "hasRole('ROLE_ADMIN')")
fun sendNotification(@RequestBody @Valid notificationRequestDto: NotificationRequestDto, @AuthenticationPrincipal userDetails: UserDetails): ResponseEntity<String>