From 0c5c7ef4be7f0a8976deac3d8dfc6e17f6602e16 Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 13 Nov 2024 18:45:14 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20ChattingListResponseDto=20=EC=83=81?= =?UTF-8?q?=EB=8C=80=EB=B0=A9=20=EC=A0=95=EB=B3=B4=EB=A5=BC=20=ED=8F=AC?= =?UTF-8?q?=ED=95=A8=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/ChattingListResponseDto.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/leets/X/domain/chat/dto/response/ChattingListResponseDto.java b/src/main/java/com/leets/X/domain/chat/dto/response/ChattingListResponseDto.java index 742ad39..2d4345a 100644 --- a/src/main/java/com/leets/X/domain/chat/dto/response/ChattingListResponseDto.java +++ b/src/main/java/com/leets/X/domain/chat/dto/response/ChattingListResponseDto.java @@ -1,22 +1,25 @@ package com.leets.X.domain.chat.dto.response; import com.leets.X.domain.chat.entity.ChatRoom; +import com.leets.X.domain.user.domain.User; public record ChattingListResponseDto( Long roomId, - Long user1Id, - Long user2Id, - String user1Name, - String user2Name, + + Long senderId, + String senderName, + + Long opponentId, + String opponentImageUrl, + String opponentName, + LatestMessageDto latestMessageDto ) { - public static ChattingListResponseDto of(ChatRoom chatRoom, LatestMessageDto latestMessageDto) { + public static ChattingListResponseDto of(Long roomId, User sender, User opponent, LatestMessageDto latestMessageDto) { return new ChattingListResponseDto( - chatRoom.getId(), - chatRoom.getUser1().getId(), - chatRoom.getUser2().getId(), - chatRoom.getUser1().getCustomId(), - chatRoom.getUser2().getCustomId(), + roomId, + sender.getId(), sender.getName(), + opponent.getId(), opponent.getName(), opponent.getImage().getUrl(), latestMessageDto ); }