diff --git a/src/main/java/org/gachon/checkmate/domain/chat/dto/response/ChatListResponseDto.java b/src/main/java/org/gachon/checkmate/domain/chat/dto/response/ChatListResponseDto.java index 2835388..5999a0c 100644 --- a/src/main/java/org/gachon/checkmate/domain/chat/dto/response/ChatListResponseDto.java +++ b/src/main/java/org/gachon/checkmate/domain/chat/dto/response/ChatListResponseDto.java @@ -15,6 +15,8 @@ public class ChatListResponseDto{ private String chatRoomId; + private Long requestUserId; + private ChatUserInfoDto chatUserInfoDto; @Builder.Default @@ -26,9 +28,10 @@ public class ChatListResponseDto{ @Builder.Default private Integer pageNumber = null; - public static ChatListResponseDto of(String chatRoomId, ChatUserInfoDto chatUserInfoDto) { + public static ChatListResponseDto of(String chatRoomId, Long requestUserId, ChatUserInfoDto chatUserInfoDto) { return ChatListResponseDto.builder() .chatRoomId(chatRoomId) + .requestUserId(requestUserId) .chatUserInfoDto(chatUserInfoDto) .build(); } diff --git a/src/main/java/org/gachon/checkmate/domain/chat/service/ChatService.java b/src/main/java/org/gachon/checkmate/domain/chat/service/ChatService.java index 312cd98..32d3589 100644 --- a/src/main/java/org/gachon/checkmate/domain/chat/service/ChatService.java +++ b/src/main/java/org/gachon/checkmate/domain/chat/service/ChatService.java @@ -98,7 +98,7 @@ public ChatListResponseDto getChatList(Map simpSessionAttributes String chatRoomId = getChatRoomId(request.otherUserId(), userId); ChatUserInfoDto chatUserInfoDto = getUserChatUserInfoByUserId(request); - ChatListResponseDto response = ChatListResponseDto.of(chatRoomId, chatUserInfoDto); + ChatListResponseDto response = ChatListResponseDto.of(chatRoomId, userId, chatUserInfoDto); PageRequest pageRequest = PageRequest.of(request.pageNumber(), request.pageSize()); Slice chatMessages = chatRepository.findBeforeChatList(chatRoomId, pageRequest);