File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
src/main/java/ita/tinybite/domain Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,14 @@ public class ChatRoomService {
4242 public List <OneToOneChatRoomResDto > getOneToOneRooms () {
4343 User user = securityProvider .getCurrentUser ();
4444
45- // 유저가 참여 중인 chatRoom (이면서 일대일 채팅만)
46- List <ChatRoom > chatRooms = chatRoomMemberRepository .findByUser (user ).stream ()
47- .map (ChatRoomMember ::getChatRoom )
48- .filter (chatRoom -> chatRoom .getType ().equals (ChatRoomType .ONE_TO_ONE )).toList ();
45+ List <ChatRoom > chatRooms = partyParticipantRepository .findByUser (user ).stream ()
46+ .map (PartyParticipant ::getOneToOneChatRoom )
47+ .filter (chatRoom -> chatRoom .getType () == ChatRoomType .ONE_TO_ONE )
48+ .toList ();
49+ // // 유저가 참여 중인 chatRoom (이면서 일대일 채팅만)
50+ // List<ChatRoom> chatRooms = chatRoomMemberRepository.findByUser(user).stream()
51+ // .map(ChatRoomMember::getChatRoom)
52+ // .filter(chatRoom -> chatRoom.getType().equals(ChatRoomType.ONE_TO_ONE)).toList();
4953
5054 return chatRooms .stream ()
5155 .map (chatRoom -> {
Original file line number Diff line number Diff line change @@ -97,4 +97,6 @@ boolean existsByParty_IdAndUser_UserIdAndStatus(
9797 Optional <PartyParticipant > findByOneToOneChatRoom (ChatRoom oneToOneChatRoom );
9898
9999 PartyParticipant findByOneToOneChatRoomAndStatus (ChatRoom oneToOneChatRoom , ParticipantStatus status );
100+
101+ List <PartyParticipant > findByUser (User user );
100102}
You can’t perform that action at this time.
0 commit comments