-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SAPHY-123 feat: 기기 검색 기능 구현 #87
The head ref may contain hidden characters: "feat/SAPHY-123-\uAE30\uAE30-\uAC80\uC0C9-\uAE30\uB2A5-\uAD6C\uD604"
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queryDSL을 아직 공부 못해서 뭘 모르겠네요 ㅎㅎ..
빨리 공부하도록 하겠습니다!
수고하셨습니다!
public Slice<Item> findByDeviceTypeAndSortType(SearchParam searchParam, Pageable pageable) { | ||
int pageSize = pageable.getPageSize(); | ||
|
||
JPAQuery<Item> basicQuery = queryFactory | ||
.selectFrom(item) | ||
.where( | ||
titleContains(searchParam.getQuery()), | ||
descriptionContains(searchParam.getQuery()), | ||
deviceTypeEquals(searchParam.getDeviceType()) | ||
) | ||
.offset(pageable.getOffset()) | ||
.limit(pageSize + 1); | ||
|
||
List<Item> content = addSortingQuery(basicQuery, searchParam.getSort()); | ||
|
||
return new SliceImpl<>(content, pageable, hasNextPage(content, pageSize)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존 page 대신 무한 스크롤 기능 때문에 Slice를 적용하셨군요!
공부해봐야겠습니다..
📄 Summary
기기 필터링 검색 및 정렬 기능을 구현했습니다.
이 외에 P6Spy를 통해 SQL 쿼리를 분석할 수 있도록 세팅해놨습니다.
application.yml 에서 다음 설정을 true로 하면 로그를 확인할 수 있습니다.
🕰️ Actual Time of Completion
🙋🏻 More