Skip to content

Commit

Permalink
Merge pull request #140 from dodunge/052-CHATROOM/FIX
Browse files Browse the repository at this point in the history
[052-CHATROOM/FIX] 채팅룸 목록 조회 에러 수정 Issue #139
  • Loading branch information
eod940 committed Mar 4, 2024
2 parents 5ac56a8 + a56be3c commit edd03e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public ResponseEntity<List<ChatRoomDto2>> getAllChatRooms(
List<ChatRoomDto2> leaderChat = tripGroupService.findChatRoomByMemberId(member.getMemberId())
.stream()
.map(TripGroup::getTripGroupId)
.map(chatRoomService::findByChatRoomId)
.map(chatRoomService::findChatRoomListByTripGroupId)
.map(chatRoom ->
ChatRoomDto2.from(chatRoom,
messageService.findLastMessage(chatRoom.getChatRoomId())))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@

import com.valuewith.tweaver.chat.entity.ChatRoom;
import com.valuewith.tweaver.group.entity.TripGroup;
import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;

public interface ChatRoomRepository extends JpaRepository<ChatRoom, Long> {
Optional<ChatRoom> findByTripGroup(TripGroup tripGroup);
Optional<ChatRoom> findByTripGroupTripGroupId(Long tripGroupId);
void deleteByTripGroupTripGroupId(Long tripGroupId);
List<ChatRoom> findChatRoomsByTripGroup_TripGroupId(Long tripGroupId);
ChatRoom findChatRoomsByTripGroup_TripGroupId(Long tripGroupId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public ChatRoom findByChatRoomId(Long chatRoomId) {
.orElseThrow(() -> new CustomException(CHAT_ROOM_NOT_FOUND));
}

public List<ChatRoom> findChatRoomListByTripGroupId(Long tripGroupId) {
public ChatRoom findChatRoomListByTripGroupId(Long tripGroupId) {
return chatRoomRepository.findChatRoomsByTripGroup_TripGroupId(tripGroupId);
}
}

0 comments on commit edd03e5

Please sign in to comment.