Skip to content

Commit

Permalink
Merge pull request #73 from BbeumbungE/fix/BACK-306
Browse files Browse the repository at this point in the history
fix: Nginx 사용으로 인한 SSE 연 API 엔드포인트 변경
  • Loading branch information
ah9mon authored Sep 28, 2023
2 parents 7e00894 + 7a6af31 commit dc21791
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/main/java/com/siliconvalley/domain/sse/api/SseConnectApi.java
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);
}
}

0 comments on commit dc21791

Please sign in to comment.