-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from BbeumbungE/fix/BACK-306
fix: Nginx 사용으로 인한 SSE 연 API 엔드포인트 변경
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/main/java/com/siliconvalley/domain/sse/api/SseConnectApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.siliconvalley.domain.sse.api; | ||
|
||
import com.siliconvalley.domain.sse.application.SseEmitterService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.*; | ||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; | ||
|
||
@RestController | ||
@RequestMapping("/sse") | ||
@RequiredArgsConstructor | ||
public class SseConnectApi { | ||
|
||
private final SseEmitterService sseEmitterService; | ||
|
||
/** | ||
* SSE Connect | ||
**/ | ||
@GetMapping("/connects/profiles/{profileId}") | ||
public SseEmitter connect( | ||
@PathVariable(name = "profileId") Long profileId, | ||
@RequestHeader(value = "Last-Event_ID", required = false, defaultValue = "") String lastEventId | ||
) | ||
{ | ||
return sseEmitterService.connect(profileId, lastEventId); | ||
} | ||
} |