Skip to content

Conversation

@kwoo28
Copy link
Contributor

@kwoo28 kwoo28 commented Jul 3, 2024

🔥 연관 이슈

현재 인증 요청 사장님 페이지에서 모든 사장님 페이지가 조회되고 있습니다.
또한 사장님 페이지네이션과 인증 요청 사장님 페이지네이션에서 DB에서 조회하는 로직이 잘못되어 두 API 로직 수정했습니다.

🚀 작업 내용

  1. 기존 사장님 페이지네이션과 인증 요청 사장님 페이지네이션 로직 수정했습니다.

💬 리뷰 중점사항

기존로직
사장님, 인증요청 사장님 페이지 네이션 : Owner 테이블의 모든 행을 포함하고, Shop 테이블에서 일치하는 행이 있으면 그 데이터를 함께 가져오는 Left Join을 사용

개선로직
사장님 페이지 네이션 : Owner의 user_id와 User의 id가 같은 데이터를 조회하여 반환
인증 요청 사장님 페이지 네이션 : IsAuthed = false인 사장님 데이터를 가져온 후 Redis에서 상점을 조회하여 반환

@kwoo28 kwoo28 self-assigned this Jul 3, 2024
@github-actions github-actions bot added the 버그 정상적으로 동작하지 않는 문제상황입니다. label Jul 3, 2024
@github-actions
Copy link

github-actions bot commented Jul 3, 2024

Unit Test Results

  26 files    26 suites   2m 28s ⏱️
226 tests 225 ✔️ 1 💤 0
227 runs  226 ✔️ 1 💤 0

Results for commit f6fd787.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@duehee duehee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~
코멘트 한 번 확인해주세요!

Comment on lines +207 to +213
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);
}
Copy link
Contributor

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}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R

이 친구가 어째서 여기에
지금보니 @NotEmozi PR이랑 섞인 거 같아요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엇..그렇네요 지우겠습니다!

Comment on lines 32 to 37
@Query("""
SELECT o FROM Owner o
JOIN o.user u
WHERE u.isAuthed = true
AND u.email LIKE CONCAT('%', :query, '%')
""")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C

아래 있는 AdminUserRepository이랑 코드 블럭 형식이 안 맞춰져있어서, 어느 하나에 맞추면 좋겠어요!
개인적으로는 이 선이랑 맞추는 게 예쁜 듯 싶네요

Suggested change
@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, '%')
""")

Copy link
Contributor Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A

궁금한 점인데, 기존의 사장님 조회에는 원래 상점이 안 나오나요?
ADMIN이 지금 오류가 있는 상태라 해서 들어가서 보는데 헷갈리네용😵

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 맞아요. 레거시에선 기존의 사장님 조회는 상점이 반환을 안하더라요!

Copy link
Contributor

@20HyeonsuLee 20HyeonsuLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘 작성해주셨네용 어프로브합니당

김원경 added 3 commits July 6, 2024 02:36
@kwoo28 kwoo28 force-pushed the fix/653-get-new-owners branch from 7341d32 to 7977400 Compare July 5, 2024 17:41
Copy link
Contributor

@duehee duehee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿~ 반영 감사합니다

@kwoo28 kwoo28 merged commit aaa6dda into develop Jul 6, 2024
@kwoo28 kwoo28 deleted the fix/653-get-new-owners branch July 6, 2024 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 정상적으로 동작하지 않는 문제상황입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

사장님 권한 요청 목록 수정

4 participants