File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
monicar-control-center/src/main/java/org/controlcenter/alarm/presentation Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 1212import org .springframework .beans .factory .annotation .Value ;
1313import org .springframework .data .domain .Pageable ;
1414import org .springframework .data .web .PageableDefault ;
15+ import org .springframework .http .MediaType ;
1516import org .springframework .security .access .prepost .PreAuthorize ;
1617import org .springframework .security .core .annotation .AuthenticationPrincipal ;
1718import org .springframework .web .bind .annotation .GetMapping ;
@@ -36,7 +37,7 @@ public class AlarmController implements AlarmApi {
3637
3738 private final AlarmService alarmService ;
3839
39- @ GetMapping ("/subscribe" )
40+ @ GetMapping (value = "/subscribe" , produces = MediaType . TEXT_EVENT_STREAM_VALUE )
4041 @ PreAuthorize ("hasRole('ROLE_USER')" )
4142 public SseEmitter subscribe (@ AuthenticationPrincipal CustomUserDetails user ) {
4243 return alarmService .subscribe (user .getId ());
You can’t perform that action at this time.
0 commit comments