Skip to content

Commit

Permalink
[COZY-225] fix : 반환 값 persona 추가 (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
veronees authored Aug 29, 2024
1 parent dfe6ce5 commit a6135cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ public static ChatRoom toEntity(Member sender, Member recipient) {
.build();
}

public static ChatRoomResponseDto toResponseDto(String nickName, String content, Long chatRoomId) {
public static ChatRoomResponseDto toResponseDto(String nickName, String content,
Long chatRoomId, Integer persona) {
return ChatRoomResponseDto.builder()
.nickName(nickName)
.lastContent(content)
.chatRoomId(chatRoomId)
.persona(persona)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@Getter
@Builder
public class ChatRoomResponseDto {
private Integer persona;
private String nickName;
private String lastContent;
private Long chatRoomId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ private ChatRoomResponseDto toChatRoomResponseDto(ChatRoom chatRoom, Member memb
return ChatRoomConverter.toResponseDto(
member.getNickname().equals(chatRoom.getMemberA().getNickname()) ?
chatRoom.getMemberB().getNickname() : chatRoom.getMemberA().getNickname(),
chat.getContent(), chatRoom.getId());
chat.getContent(),
chatRoom.getId(),
member.getNickname().equals(chatRoom.getMemberA().getNickname()) ?
chatRoom.getMemberB().getPersona() : chatRoom.getMemberA().getPersona());
}
}

0 comments on commit a6135cc

Please sign in to comment.