Skip to content

Commit

Permalink
Merge pull request #40 from VOM-Project/feature/fcm
Browse files Browse the repository at this point in the history
feat: Add fcmService when CreatingWebcamRoom
  • Loading branch information
okodeee authored Jun 11, 2024
2 parents f81c87e + 011b9f7 commit c3653c1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@
import vom.spring.domain.webcam.dto.WebcamRequestDto;
import vom.spring.domain.webcam.dto.WebcamResponseDto;
import vom.spring.domain.webcam.service.WebcamServcie;
import vom.spring.domain.webpush.service.FcmService;

import java.io.IOException;

@Tag(name = "화상채팅(시그널링) API", description = "화상채팅 API 명세서")
@RestController
@RequiredArgsConstructor
@Slf4j
public class WebcamController {
private final WebcamServcie webcamServcie;
private final FcmService fcmService;
// private final SimpMessagingTemplate messagingTemplate;
/**
* 방 생성
Expand All @@ -41,8 +45,9 @@ public class WebcamController {
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
})
@PostMapping("/api/webcam")
public ResponseEntity<WebcamResponseDto.CreateWebcamDto> createWebcamRoom(@RequestBody WebcamRequestDto.CreateWebcamDto request) {
public ResponseEntity<WebcamResponseDto.CreateWebcamDto> createWebcamRoom(@RequestBody WebcamRequestDto.CreateWebcamDto request) throws IOException {
WebcamResponseDto.CreateWebcamDto response = webcamServcie.createWebcamRoom(request);
fcmService.sendMessageTo(request.getToMemberId());
return ResponseEntity.status(HttpStatus.OK).body(response);
}
/**
Expand Down

0 comments on commit c3653c1

Please sign in to comment.