-
Notifications
You must be signed in to change notification settings - Fork 2
fix: 어드민 사장님 페이지네이션 수정 #654
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
duehee
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.
고생하셨습니다~
코멘트 한 번 확인해주세요!
| if (ownersCondition.searchType() == OwnersCondition.SearchType.EMAIL) { | ||
| result = adminOwnerRepository.findPageOwnersByEmail(ownersCondition.query(), pageRequest); | ||
| } else if (ownersCondition.searchType() == OwnersCondition.SearchType.NAME) { | ||
| result = adminOwnerRepository.findPageOwnersByName(ownersCondition.query(), pageRequest); | ||
| } else { | ||
| result = adminOwnerRepository.findPageOwners(pageRequest); | ||
| } |
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.
A
위 JPQL에서 왜 나누어져서 작성했나 했더니, 여기 부분이 있었네요!
| public record StudentLoginRequest( | ||
| @Schema(description = "이메일", example = "koin123@koreatech.ac.kr", requiredMode = REQUIRED) | ||
| @NotBlank(message = "이메일을 입력해주세요.") | ||
| @Email(message = "이메일 형식을 지켜주세요. ${validatedValue}") |
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.
R
이 친구가 어째서 여기에
지금보니 @NotEmozi PR이랑 섞인 거 같아요
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.
엇..그렇네요 지우겠습니다!
| @Query(""" | ||
| SELECT o FROM Owner o | ||
| JOIN o.user u | ||
| WHERE u.isAuthed = true | ||
| AND u.email LIKE CONCAT('%', :query, '%') | ||
| """) |
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.
C
아래 있는 AdminUserRepository이랑 코드 블럭 형식이 안 맞춰져있어서, 어느 하나에 맞추면 좋겠어요!
개인적으로는 이 선이랑 맞추는 게 예쁜 듯 싶네요
| @Query(""" | |
| SELECT o FROM Owner o | |
| JOIN o.user u | |
| WHERE u.isAuthed = true | |
| AND u.email LIKE CONCAT('%', :query, '%') | |
| """) | |
| @Query(""" | |
| SELECT o FROM Owner o | |
| JOIN o.user u | |
| WHERE u.isAuthed = true | |
| AND u.email LIKE CONCAT('%', :query, '%') | |
| """) |
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.
맞추겠습니다! 감사합니다
| }) | ||
| .collect(Collectors.toList()); | ||
|
|
||
| return AdminNewOwnersResponse.of(ownerIncludingShops, result, criteria); |
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.
A
궁금한 점인데, 기존의 사장님 조회에는 원래 상점이 안 나오나요?
ADMIN이 지금 오류가 있는 상태라 해서 들어가서 보는데 헷갈리네용😵
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.
네 맞아요. 레거시에선 기존의 사장님 조회는 상점이 반환을 안하더라요!
20HyeonsuLee
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.
잘 작성해주셨네용 어프로브합니당
… fix/653-get-new-owners # Conflicts: # src/main/java/in/koreatech/koin/global/validation/EmojiValidator.java
7341d32 to
7977400
Compare
duehee
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.
굿~ 반영 감사합니다
🔥 연관 이슈
현재 인증 요청 사장님 페이지에서 모든 사장님 페이지가 조회되고 있습니다.
또한 사장님 페이지네이션과 인증 요청 사장님 페이지네이션에서 DB에서 조회하는 로직이 잘못되어 두 API 로직 수정했습니다.
🚀 작업 내용
💬 리뷰 중점사항
기존로직
사장님, 인증요청 사장님 페이지 네이션 : Owner 테이블의 모든 행을 포함하고, Shop 테이블에서 일치하는 행이 있으면 그 데이터를 함께 가져오는 Left Join을 사용
개선로직
사장님 페이지 네이션 : Owner의 user_id와 User의 id가 같은 데이터를 조회하여 반환
인증 요청 사장님 페이지 네이션 : IsAuthed = false인 사장님 데이터를 가져온 후 Redis에서 상점을 조회하여 반환