From 73fdd775b42b9770a05eb33079c80312f6469c8d Mon Sep 17 00:00:00 2001 From: koreaioi Date: Wed, 13 Nov 2024 18:44:51 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20ChattingDto=20=EC=83=81=EB=8C=80?= =?UTF-8?q?=EB=B0=A9=20=EC=A0=95=EB=B3=B4=EB=A5=BC=20=ED=8F=AC=ED=95=A8?= =?UTF-8?q?=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 --- .../domain/chat/dto/response/ChattingDto.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/leets/X/domain/chat/dto/response/ChattingDto.java b/src/main/java/com/leets/X/domain/chat/dto/response/ChattingDto.java index ef4736f..1a53494 100644 --- a/src/main/java/com/leets/X/domain/chat/dto/response/ChattingDto.java +++ b/src/main/java/com/leets/X/domain/chat/dto/response/ChattingDto.java @@ -1,12 +1,26 @@ package com.leets.X.domain.chat.dto.response; +import com.leets.X.domain.user.domain.User; + import java.util.List; public record ChattingDto( - Long user1Id, - Long user2Id, - String user1Name, - String user2Name, + Long senderId, + String senderName, + + Long opponentId, + String opponentImageUrl, + String opponentName, + List chatMessageList ) { + + public static ChattingDto of(User sender, User opponent, List chatMessageList) { + return new ChattingDto( + sender.getId(), sender.getName(), + opponent.getId(), opponent.getName(), opponent.getImage().getUrl(), + chatMessageList + ); + } + }