-
Notifications
You must be signed in to change notification settings - Fork 6
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
refactor : 메인페이지 공연 정렬 순서 변경 #567
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.
spotless 한번 돌려주셔유!
.where(eqStatusOpen().and(nameContains(keyword))) | ||
.orderBy(createdAtAsc()) |
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.
and로 묶어주는것도 좋네용
final long remainingSize = Math.max(pageable.getPageSize() - openEvents.size(), 0); | ||
if (remainingSize > 0) { | ||
openEvents.addAll(queryClosedEventsByKeywordAndSize(keyword, pageable, remainingSize)); | ||
} |
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.
오 이 로직은 무슨역할이죵
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.
정렬 순서가 앞 뒤로 달라서 어쩔 수 없이 쿼리를 두번 쏴서 페이징하는데
OPEN 상태인 공연 개수 결과를 세서 pageSize 보다 작으면
pageSize - OPEN 공연수
계산해서 나머지 개수만큼 limit 해서 CLOSED 공연을 가져오는 로직입니다
근데 이미 OPEN 공연을 pageSize 만큼 전부 가져왔을 수도 있으니
그 때는 CLOSED 공연 가져오는 쿼리 안날라가도록 조건문으로 최적화 했습니다~
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.
LGTM
근데 찬진이 말대로 spotless 깨진거 같에용
Kudos, SonarCloud Quality Gate passed! |
개요
작업사항
진행중인 공연
: 등록일 순서 (by createdAt)지난 공연
: 공연일 순서 (by startAt)변경로직
domain/event