Skip to content

Commit

Permalink
fix: tag검색 동적쿼리 누락 건 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
geneaky committed Oct 6, 2024
1 parent 958f3c7 commit 87246a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -49,7 +48,7 @@ public ChatRoomQueryRepositoryImpl(JPAQueryFactory queryFactory) {
this.queryFactory = queryFactory;
}

private BooleanExpression inTags(QHashTagEntity hashTagEntity, List<String> tags) {
private BooleanExpression inTags(List<String> tags) {
if (tags.isEmpty()) {
return null;
}
Expand Down Expand Up @@ -192,7 +191,8 @@ public Slice<ChatRoomResponse> 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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

0 comments on commit 87246a5

Please sign in to comment.