Skip to content

Commit fa9b3cb

Browse files
authored
Merge pull request #328 from Kernel360/fix/#326-fix-SSE-alarm
fix: 점검 알람 컨트롤러 미디어 타입 명시적 지정
2 parents 4fc9903 + 4c6c7c8 commit fa9b3cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

monicar-control-center/src/main/java/org/controlcenter/alarm/presentation/AlarmController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.springframework.beans.factory.annotation.Value;
1313
import org.springframework.data.domain.Pageable;
1414
import org.springframework.data.web.PageableDefault;
15+
import org.springframework.http.MediaType;
1516
import org.springframework.security.access.prepost.PreAuthorize;
1617
import org.springframework.security.core.annotation.AuthenticationPrincipal;
1718
import 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());

0 commit comments

Comments
 (0)