Skip to content

Commit

Permalink
[feat] #57 이전 채팅 조회 응답값 requestUserId 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
OJOJIN committed Jan 22, 2024
1 parent 95948cd commit 7907393
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class ChatListResponseDto{

private String chatRoomId;

private Long requestUserId;

private ChatUserInfoDto chatUserInfoDto;

@Builder.Default
Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public ChatListResponseDto getChatList(Map<String, Object> 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<Chat> chatMessages = chatRepository.findBeforeChatList(chatRoomId, pageRequest);
Expand Down

0 comments on commit 7907393

Please sign in to comment.