From c68b115bfac19cbb757ec06c5067a5f83773567f Mon Sep 17 00:00:00 2001 From: sua kang Date: Wed, 21 Feb 2024 16:04:42 +0900 Subject: [PATCH] refactor: add JoinedRoomResponseDto missing field - playlist --- .../chattingserver/dto/response/JoinedRoomResponseDto.java | 6 ++++-- .../src/main/java/chattingserver/service/RoomService.java | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/backend/chatting-server/src/main/java/chattingserver/dto/response/JoinedRoomResponseDto.java b/src/backend/chatting-server/src/main/java/chattingserver/dto/response/JoinedRoomResponseDto.java index 96ffe2c6..949198bd 100644 --- a/src/backend/chatting-server/src/main/java/chattingserver/dto/response/JoinedRoomResponseDto.java +++ b/src/backend/chatting-server/src/main/java/chattingserver/dto/response/JoinedRoomResponseDto.java @@ -1,6 +1,7 @@ package chattingserver.dto.response; import chattingserver.domain.chat.LastMessage; +import chattingserver.domain.room.Playlist; import chattingserver.domain.room.User; import lombok.*; import java.util.List; @@ -11,11 +12,12 @@ @AllArgsConstructor @ToString public class JoinedRoomResponseDto { - private String roomId; + private String id; private String roomName; private long userCount; - private String thumbnailImage; private List users; private UserListResponseDto playlistOwner; + private Playlist playlist; + private String thumbnailImage; private LastMessage lastMessage; } diff --git a/src/backend/chatting-server/src/main/java/chattingserver/service/RoomService.java b/src/backend/chatting-server/src/main/java/chattingserver/service/RoomService.java index 4f01e218..fc00ceb4 100644 --- a/src/backend/chatting-server/src/main/java/chattingserver/service/RoomService.java +++ b/src/backend/chatting-server/src/main/java/chattingserver/service/RoomService.java @@ -58,12 +58,13 @@ public List findJoinedRoomsByUid(Long uid) { .build(); myRoomsDto.add(JoinedRoomResponseDto.builder() - .roomId(roomId) + .id(roomId) .roomName(room.getRoomName()) - .thumbnailImage(room.getThumbnailImage()) - .users(room.getUsers()) .userCount(room.getUsers().size()) + .users(room.getUsers()) .playlistOwner(entityToResponseDtoConverter.convertUser(room.getPlaylistOwner())) + .playlist(room.getPlaylist()) + .thumbnailImage(room.getThumbnailImage()) .lastMessage(lastMessage) .build()); }