Skip to content

Commit

Permalink
[fix] #57 이전 채팅 조회 destination 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
OJOJIN committed Jan 22, 2024
1 parent 7907393 commit d56c3b4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ public class ChatController {
public void sendChat(@Header("simpSessionAttributes") Map<String, Object> simpSessionAttributes,
@Payload final ChatRequestDto request) {
ChatResponseDto response = chatService.sendChat(simpSessionAttributes, request);
sendingOperations.convertAndSend("/queue/chat/"+simpSessionAttributes.get("roomId"), SocketBaseResponse.of(MessageType.CHAT, response));
sendingOperations.convertAndSend("/queue/chat/" + simpSessionAttributes.get("roomId"), SocketBaseResponse.of(MessageType.CHAT, response));
}

// 채팅방 정보 조회
@MessageMapping("/room-list")
public void getChatRoomList(@Header("simpSessionAttributes") Map<String, Object> simpSessionAttributes) {
ChatRoomListResponseDto response = chatService.getChatRoomList(simpSessionAttributes);
sendingOperations.convertAndSend("/queue/user/"+simpSessionAttributes.get("userId"), SocketBaseResponse.of(MessageType.ROOM_LIST, response));
sendingOperations.convertAndSend("/queue/user/" + simpSessionAttributes.get("userId"), SocketBaseResponse.of(MessageType.ROOM_LIST, response));
}

// 이전 채팅 불러오기
@MessageMapping("/chat-list")
public void getChatList(@Header("simpSessionAttributes") Map<String, Object> simpSessionAttributes,
@Payload final ChatListRequestDto request) {
final ChatListResponseDto response = chatService.getChatList(simpSessionAttributes, request);
sendingOperations.convertAndSend("/queue/user/" + simpSessionAttributes.get("userId"), SocketBaseResponse.of(MessageType.CHAT_LIST, response));
ChatListResponseDto response = chatService.getChatList(simpSessionAttributes, request);
sendingOperations.convertAndSend("/queue/chat/" + response.getChatRoomId(), SocketBaseResponse.of(MessageType.CHAT_LIST, response));
}

// 채팅방 입장하기
Expand Down

0 comments on commit d56c3b4

Please sign in to comment.