Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev -> main #170

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

![Algobaro Logo](https://github.com/1e5i-Shark/algobaro-api/assets/113650170/011959cc-09a9-468d-853b-e7c20b13c9e8)

- [Deploy Link](https://algobaro.vercel.app)
- [GitHub Wiki](https://github.com/1e5i-Shark/algobaro-api/wiki)
- [FE Repository](https://github.com/1e5i-Shark/algobaro-fe)
- 서비스 배포 링크 - [Link](https://algobaro.vercel.app)
- 해당 프로젝트에 대한 자세한 정보 - [GitHub Wiki](https://github.com/1e5i-Shark/algobaro-api/wiki)
- 프로젝트 웹 클라이언트 Repository - [GitHub Repository](https://github.com/1e5i-Shark/algobaro-fe)
- 소켓 기본 연결 테스트 클라이언트 Repository - [GitHub Repository](https://github.com/hyoguoo/socket-test-client)

<br>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package ei.algobaroapi.domain.chat.controller;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.handler.annotation.DestinationVariable;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequiredArgsConstructor
public class SignallingController {

@MessageMapping("/peer/offer/{camKey}/{roomShortUuid}")
@SendTo("/topic/peer/offer/{camKey}/{roomShortUuid}")
public String peerHandleOffer(
@Payload String offer,
@DestinationVariable(value = "roomShortUuid") String roomShortUuid,
@DestinationVariable(value = "camKey") String camKey
) {
log.info("[OFFER] {} : {}", camKey, offer);
return offer;
}

//iceCandidate 정보를 주고 받기 위한 webSocket
//camKey : 각 요청하는 캠의 key , roomShortUuid : 룸 아이디
@MessageMapping("/peer/iceCandidate/{camKey}/{roomShortUuid}")
@SendTo("/topic/peer/iceCandidate/{camKey}/{roomShortUuid}")
public String peerHandleIceCandidate(
@Payload String candidate,
@DestinationVariable(value = "roomShortUuid") String roomShortUuid,
@DestinationVariable(value = "camKey") String camKey
) {
log.info("[ICECANDIDATE] {} : {}", camKey, candidate);
return candidate;
}

//
@MessageMapping("/peer/answer/{camKey}/{roomShortUuid}")
@SendTo("/topic/peer/answer/{camKey}/{roomShortUuid}")
public String peerHandleAnswer(
@Payload String answer,
@DestinationVariable(value = "roomShortUuid") String roomShortUuid,
@DestinationVariable(value = "camKey") String camKey
) {
log.info("[ANSWER] {} : {}", camKey, answer);
return answer;
}

//camKey 를 받기위해 신호를 보내는 webSocket
@MessageMapping("/call/key")
@SendTo("/topic/call/key")
public String callKey(@Payload String message) {
log.info("[Key] : {}", message);
return message;
}

//자신의 camKey 를 모든 연결된 세션에 보내는 webSocket
@MessageMapping("/send/key")
@SendTo("/topic/send/key")
public String sendKey(@Payload String message) {
return message;
}
}
Loading