-
Notifications
You must be signed in to change notification settings - Fork 4
CLAP-215 fix: 감사로깅 API 시간 정렬 파라미터 추가 #219
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
Conversation
| public ResponseEntity<PageResponse<AnonymousLogResponse>> getLoginAttempts( | ||
| @RequestParam(defaultValue = "0") int page, | ||
| @RequestParam(defaultValue = "20") int pageSize, | ||
| @RequestParam(defaultValue = "timestamp") String sortBy, | ||
| @RequestParam(defaultValue = "desc") String sortDirection, | ||
| @ModelAttribute FilterLogRequest anonymousLogRequest, | ||
| @AuthenticationPrincipal SecurityUserDetails userInfo) { | ||
| Pageable pageable = PageRequest.of(page, pageSize); | ||
| Pageable pageable = PageRequest.of( | ||
| page, |
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.
timestamp가 어디 정의되어있나요?
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.
default value의 경우 requestAt으로 해야할 것 같습니다.
추가로 .orderBy(memberLogEntity.createdAt.desc()) 속성이 이미 설정되어있는데 pagable로 설정했을때 pagable이 적용되는지 확인해주시고 안되시면 pagable 대신 orderBy를 동적으로 적용하는 방식으로 진행하면 될 것 같습니다.
List<MemberLogEntity> result = queryFactory
.selectFrom(memberLogEntity)
.where(builder)
.leftJoin(memberLogEntity.member, memberEntity)
.orderBy(memberLogEntity.createdAt.desc())
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
.fetch();
long total = queryFactory
.selectFrom(memberLogEntity)
.where(builder)
.fetch().size();
return new PageImpl<>(result, pageable, total);
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.
수정하였습니다. 확인부탁드립니다!
@parkjaehak
joowojr
left a comment
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.
수고하셨습니다!
📄 요약(Summary)
✍🏼 상세(More)
PR Desciption
Requirements for Reviewer
PR Log
새롭게 배운 것
고민 중인 사항
첨부 자료
Requirements for Reviewer
✅ 체크리스트(Checklist)
🚪 이슈 번호(Issue numbers)
Closes #218