-
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
[TNT-212] refactor: 회원 조회 API 응답 데이터 추가 #46
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.
👍 변수명이랑 쿼리문은 일단 함께 다시 생각해보는게 좋아보입니다!
Integer managementMember, | ||
Integer fellowMember, |
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.
해당 이름들을 봤을때는 어떤 값인지 알기 힘든거 같아요!
- active_trainee_count
- previous_trainee_count
를 생각해봤는데 더 좋은 이름이 생각나면 말해주세요 ㅎㅎ
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.
이게 좀 더 직관적인 것 같습니다 !
String invitationCode, | ||
Long trainerId, |
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.
question
: 혹시 연결 끊기 때문에 추가가 된 것인가요??
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.
요건 추후에라도 쓸 것 같아서 코드랑 같이 보내자는 의도였는데 당장 불필요한 것 같아서 빼도록 하겠습니다 ~
.where( | ||
member.id.eq(memberId), | ||
member.deletedAt.isNull() | ||
) | ||
.transform(GroupBy.groupBy(member.id).as( | ||
new QMemberProjection_MemberInfoDto(member.name, member.email, member.profileImageUrl, member.birthday, | ||
member.memberType, member.socialType, trainer.invitationCode, trainee.height, trainee.weight, | ||
trainee.cautionNote, GroupBy.list(ptGoal.content) | ||
member.memberType, member.socialType, |
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.
일단 성능상 서브쿼리는 최대한 피하는 것이 좋고, 서브쿼리는 leftjoin으로 대부분 해결되는 것으로 알고 있습니다.
또 이제 보니 위에
leftJoin(trainer).on(trainer.member.id.eq(member.id), trainer.deletedAt.isNull())
.leftJoin(trainee).on(trainee.member.id.eq(member.id), trainee.deletedAt.isNull())
이부분도 뭔가 이상한거 같아서,,, 전체적으로 쿼리를 다시 손봐야할 듯 싶습니다!
한번 고민 해보시고 해결이 잘 안되면 내일 같이 다시 생각해보죠!
+++ 이 쿼리를 쓰는 통합테스트도 있으면 좋지 않을까 생각합니다! (controller)
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.
고생하셨습니다~~👍👍👍
📋 Checklist
[APP2-77] feat: 회원 인증 Filter 구현
)🎟️ Issue
✅ Tasks
회원 조회 API
추가
🙋🏻 More