diff --git a/src/main/java/toy/bookchat/bookchat/db_module/chatroom/repository/query/ChatRoomQueryRepositoryImpl.java b/src/main/java/toy/bookchat/bookchat/db_module/chatroom/repository/query/ChatRoomQueryRepositoryImpl.java index 40e1d5c2..980e1a44 100644 --- a/src/main/java/toy/bookchat/bookchat/db_module/chatroom/repository/query/ChatRoomQueryRepositoryImpl.java +++ b/src/main/java/toy/bookchat/bookchat/db_module/chatroom/repository/query/ChatRoomQueryRepositoryImpl.java @@ -10,8 +10,8 @@ import static toy.bookchat.bookchat.db_module.chatroom.QHashTagEntity.hashTagEntity; import static toy.bookchat.bookchat.db_module.participant.QParticipantEntity.participantEntity; import static toy.bookchat.bookchat.db_module.user.QUserEntity.userEntity; -import static toy.bookchat.bookchat.support.RepositorySupport.toSlice; import static toy.bookchat.bookchat.domain.participant.ParticipantStatus.HOST; +import static toy.bookchat.bookchat.support.RepositorySupport.toSlice; import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.Expressions; @@ -26,7 +26,6 @@ import toy.bookchat.bookchat.db_module.book.BookEntity; import toy.bookchat.bookchat.db_module.chat.QChatEntity; import toy.bookchat.bookchat.db_module.chatroom.ChatRoomEntity; -import toy.bookchat.bookchat.db_module.chatroom.QHashTagEntity; import toy.bookchat.bookchat.db_module.chatroom.repository.query.dto.ChatRoomParticipantModel; import toy.bookchat.bookchat.db_module.chatroom.repository.query.dto.ChatRoomResponse; import toy.bookchat.bookchat.db_module.chatroom.repository.query.dto.QChatRoomParticipantModel; @@ -49,7 +48,7 @@ public ChatRoomQueryRepositoryImpl(JPAQueryFactory queryFactory) { this.queryFactory = queryFactory; } - private BooleanExpression inTags(QHashTagEntity hashTagEntity, List tags) { + private BooleanExpression inTags(List tags) { if (tags.isEmpty()) { return null; } @@ -192,7 +191,8 @@ public Slice findChatRooms(ChatRoomRequest chatRoomRequest, Pa ltCursorId(chatRoomRequest.getPostCursorId()), eqIsbn(chatRoomRequest.getIsbn()), containsTitle(chatRoomRequest.getTitle()), - containsRoomName(chatRoomRequest.getRoomName()) + containsRoomName(chatRoomRequest.getRoomName()), + inTags(chatRoomRequest.getTags()) ) .limit(pageable.getPageSize()) .orderBy(chatEntity.id.desc(), chatRoomEntity.id.desc()) diff --git a/src/main/java/toy/bookchat/bookchat/localtest/rest/chatroom/ChatRoomAPI.http b/src/main/java/toy/bookchat/bookchat/localtest/rest/chatroom/ChatRoomAPI.http index 61da849a..e632194d 100644 --- a/src/main/java/toy/bookchat/bookchat/localtest/rest/chatroom/ChatRoomAPI.http +++ b/src/main/java/toy/bookchat/bookchat/localtest/rest/chatroom/ChatRoomAPI.http @@ -62,5 +62,5 @@ Authorization: {{jwt_token}} ### 전체 채팅방 조회 -GET localhost:8080/v1/api/chatrooms?isbn=1234567890 +GET localhost:8080/v1/api/chatrooms?tags=a Authorization: {{jwt_token}} \ No newline at end of file