Skip to content

Commit

Permalink
Merge pull request #395 from 6QuizOnTheBlock/be/refactor/#387-chat_re…
Browse files Browse the repository at this point in the history
…factoring

refactor: ChatHandler switch 패턴매칭으로 변경
  • Loading branch information
dalcheonroadhead authored May 30, 2024
2 parents 44bdbb0 + d2f2d85 commit 12d8e93
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ private void handleMessage(
StompCommand stompCommand, StompHeaderAccessor accessor
) {
switch (stompCommand) {
case CONNECT:
case StompCommand.CONNECT -> {
String memberId = verifyAccessToken(getAccessToken(accessor));
String type = accessor.getFirstNativeHeader("type");
if (type != null && type.equals("quiz")) {
break;
}
connectToChatRoom(accessor, memberId);
break;
case SUBSCRIBE, SEND:
}
case StompCommand.SUBSCRIBE, StompCommand.SEND ->
verifyAccessToken(getAccessToken(accessor));
break;
default:
default -> {
}
}
}

Expand Down

0 comments on commit 12d8e93

Please sign in to comment.