Skip to content
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

Merged
merged 8 commits into from
Feb 10, 2025

Conversation

fakerdeft
Copy link
Contributor

📋 Checklist

  • 🔀 PR 제목의 형식을 잘 작성했나요? (e.g. [APP2-77] feat: 회원 인증 Filter 구현)
  • 💯 테스트는 잘 통과했나요?
  • 🏗️ 빌드에 성공했나요?
  • 🧹 불필요한 코드는 제거했나요?

🎟️ Issue

✅ Tasks

회원 조회 API

  • 응답에 트레이너 경우 관리 중인/함께했던 회원 수 추가했습니다.
  • 응답에 트레이니 경우 트레이너ID 추가했습니다.

추가

  • 회원 프로필 기본 이미지 svg -> png 파일로 수정했습니다.

🙋🏻 More

  • 참고 내용

@fakerdeft fakerdeft added the ♻ refactor 기존 코드 리팩토링 label Feb 7, 2025
@fakerdeft fakerdeft requested a review from ymkim97 February 7, 2025 05:21
@fakerdeft fakerdeft self-assigned this Feb 7, 2025
Copy link
Contributor

@ymkim97 ymkim97 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 29 to 30
Integer managementMember,
Integer fellowMember,
Copy link
Contributor

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

를 생각해봤는데 더 좋은 이름이 생각나면 말해주세요 ㅎㅎ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이게 좀 더 직관적인 것 같습니다 !

String invitationCode,
Long trainerId,
Copy link
Contributor

Choose a reason for hiding this comment

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

question: 혹시 연결 끊기 때문에 추가가 된 것인가요??

Copy link
Contributor Author

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,
Copy link
Contributor

@ymkim97 ymkim97 Feb 7, 2025

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)

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

@ymkim97 ymkim97 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~~👍👍👍

@fakerdeft fakerdeft merged commit 1287413 into develop Feb 10, 2025
2 checks passed
@fakerdeft fakerdeft deleted the feature/TNT-212 branch February 10, 2025 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻ refactor 기존 코드 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

회원 조회 기능 리팩토링
2 participants