Skip to content

Commit

Permalink
fix: ChattingDto 상대방 정보를 포함하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
koreaioi committed Nov 13, 2024
1 parent 20f5230 commit 73fdd77
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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<ChatMessageResponseDto> chatMessageList
) {

public static ChattingDto of(User sender, User opponent, List<ChatMessageResponseDto> chatMessageList) {
return new ChattingDto(
sender.getId(), sender.getName(),
opponent.getId(), opponent.getName(), opponent.getImage().getUrl(),
chatMessageList
);
}

}

0 comments on commit 73fdd77

Please sign in to comment.