1212import io .f1 .backend .domain .game .dto .response .GameStartResponse ;
1313import io .f1 .backend .domain .game .dto .response .PlayerListResponse ;
1414import io .f1 .backend .domain .user .dto .UserPrincipal ;
15+
1516import lombok .RequiredArgsConstructor ;
17+
1618import org .springframework .messaging .Message ;
1719import org .springframework .messaging .handler .annotation .DestinationVariable ;
1820import org .springframework .messaging .handler .annotation .MessageMapping ;
@@ -36,18 +38,18 @@ public void initializeRoomSocket(@DestinationVariable Long roomId, Message<?> me
3638 UserPrincipal principal = getSessionUser (message );
3739
3840 RoomInitialData roomInitialData =
39- roomService .initializeRoomSocket (roomId , websocketSessionId , principal );
41+ roomService .initializeRoomSocket (roomId , websocketSessionId , principal );
4042
4143 String destination = getDestination (roomId );
4244
4345 messageSender .send (
44- destination , MessageType .ROOM_SETTING , roomInitialData .roomSettingResponse ());
46+ destination , MessageType .ROOM_SETTING , roomInitialData .roomSettingResponse ());
4547 messageSender .send (
46- destination , MessageType .GAME_SETTING , roomInitialData .gameSettingResponse ());
48+ destination , MessageType .GAME_SETTING , roomInitialData .gameSettingResponse ());
4749 messageSender .send (
48- destination , MessageType .PLAYER_LIST , roomInitialData .playerListResponse ());
50+ destination , MessageType .PLAYER_LIST , roomInitialData .playerListResponse ());
4951 messageSender .send (
50- destination , MessageType .SYSTEM_NOTICE , roomInitialData .systemNoticeResponse ());
52+ destination , MessageType .SYSTEM_NOTICE , roomInitialData .systemNoticeResponse ());
5153 }
5254
5355 @ MessageMapping ("/room/exit/{roomId}" )
@@ -62,19 +64,19 @@ public void exitRoom(@DestinationVariable Long roomId, Message<?> message) {
6264
6365 if (!roomExitData .isRemovedRoom ()) {
6466 messageSender .send (
65- destination , MessageType .PLAYER_LIST , roomExitData .getPlayerListResponses ());
67+ destination , MessageType .PLAYER_LIST , roomExitData .getPlayerListResponses ());
6668 messageSender .send (
67- destination , MessageType .SYSTEM_NOTICE , roomExitData .getSystemNoticeResponse ());
69+ destination , MessageType .SYSTEM_NOTICE , roomExitData .getSystemNoticeResponse ());
6870 }
6971 }
7072
7173 @ MessageMapping ("/room/start/{roomId}" )
7274 public void gameStart (
73- @ DestinationVariable Long roomId ,
74- Message <DefaultWebSocketRequest <GameStartRequest >> message ) {
75+ @ DestinationVariable Long roomId ,
76+ Message <DefaultWebSocketRequest <GameStartRequest >> message ) {
7577
76- GameStartResponse gameStartResponse = gameService . gameStart ( roomId ,
77- message .getPayload ().getMessage ());
78+ GameStartResponse gameStartResponse =
79+ gameService . gameStart ( roomId , message .getPayload ().getMessage ());
7880
7981 String destination = getDestination (roomId );
8082
@@ -83,31 +85,31 @@ public void gameStart(
8385
8486 @ MessageMapping ("room/chat/{roomId}" )
8587 public void chat (
86- @ DestinationVariable Long roomId ,
87- Message <DefaultWebSocketRequest <ChatMessage >> message ) {
88+ @ DestinationVariable Long roomId ,
89+ Message <DefaultWebSocketRequest <ChatMessage >> message ) {
8890 RoundResult roundResult =
89- roomService .chat (roomId , getSessionId (message ), message .getPayload ().getMessage ());
91+ roomService .chat (roomId , getSessionId (message ), message .getPayload ().getMessage ());
9092
9193 String destination = getDestination (roomId );
9294
9395 messageSender .send (destination , MessageType .CHAT , roundResult .getChat ());
9496
9597 if (!roundResult .hasOnlyChat ()) {
9698 messageSender .send (
97- destination , MessageType .QUESTION_RESULT , roundResult .getQuestionResult ());
99+ destination , MessageType .QUESTION_RESULT , roundResult .getQuestionResult ());
98100 messageSender .send (destination , MessageType .RANK_UPDATE , roundResult .getRankUpdate ());
99101 messageSender .send (
100- destination , MessageType .SYSTEM_NOTICE , roundResult .getSystemNotice ());
102+ destination , MessageType .SYSTEM_NOTICE , roundResult .getSystemNotice ());
101103 }
102104 }
103105
104106 @ MessageMapping ("/room/ready/{roomId}" )
105107 public void playerReady (@ DestinationVariable Long roomId , Message <?> message ) {
106108
107- PlayerListResponse playerListResponse = roomService .handlePlayerReady (roomId , getSessionId (message ));
109+ PlayerListResponse playerListResponse =
110+ roomService .handlePlayerReady (roomId , getSessionId (message ));
108111
109- messageSender .send (
110- getDestination (roomId ), MessageType .PLAYER_LIST , playerListResponse );
112+ messageSender .send (getDestination (roomId ), MessageType .PLAYER_LIST , playerListResponse );
111113 }
112114
113115 private static String getSessionId (Message <?> message ) {
0 commit comments