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

[feature/19] 프로필 조회 구현 #22

Merged
merged 3 commits into from
Jul 23, 2024
Merged

[feature/19] 프로필 조회 구현 #22

merged 3 commits into from
Jul 23, 2024

Conversation

injoon2019
Copy link
Collaborator

💡 이슈 번호

close: #19

✨ 작업 내용

프로필 조회 기능 구현입니다

🚀 전달 사항

Comment on lines 27 to 28
it.user = user
it.profileSelect = profileSelect
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이전 pr 코드리뷰 반영했습니다!

Copy link
Member

Choose a reason for hiding this comment

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

엇 여기는 �profileSelect를 변경하는거라 it.profileSelect = profileSelect가 있어야해요!ㅋㅋㅋ

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

수정해둘게요!

@@ -9,6 +10,8 @@ class User(
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long = 0,

var birthdate: LocalDate? = null,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

생년월일을 저장하고 나이가 필요하면 계산해서 줘야겠네요

Copy link
Member

Choose a reason for hiding this comment

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

이거 카카오에서 주는 정보가 생년월일 밖에 없어서 그런건가요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

앗 아뇨! 나이를 저장하면 두 가지 문제가 있을거 같아요.

  • 매년 해가 바뀔때마다 1씩 증가시켜줘야함
  • 만 나이 제도를 적용하고 싶을 때 유연하지 않음

그래서 생년월일을 저장하는게 훨씬 유리할거 같아요!

@injoon2019 injoon2019 changed the title feat: 프로필 조회 구현 [feature/19] 프로필 조회 구현 Jul 22, 2024
@injoon2019 injoon2019 self-assigned this Jul 22, 2024
Copy link
Member

@miseongk miseongk left a comment

Choose a reason for hiding this comment

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

크게 변경될 사항이 없어서 바로 Approve 할게요~!!
고생하셨습니다 🙇‍♀️

@@ -9,6 +10,8 @@ class User(
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long = 0,

var birthdate: LocalDate? = null,
Copy link
Member

Choose a reason for hiding this comment

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

이거 카카오에서 주는 정보가 생년월일 밖에 없어서 그런건가요??

Comment on lines 27 to 28
it.user = user
it.profileSelect = profileSelect
Copy link
Member

Choose a reason for hiding this comment

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

엇 여기는 �profileSelect를 변경하는거라 it.profileSelect = profileSelect가 있어야해요!ㅋㅋㅋ


@Transactional(readOnly = true)
fun findUserProfile(userId: Long): UserProfile? {
return profileRepository.findByUserId(userId)
Copy link
Member

Choose a reason for hiding this comment

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

오 저도 오랜만에 해서 까먹었었는데 생각해보니까
profileRepository.findByUser(user)
이렇게 id로 찾지 않고 객체로 찾아왔던 것 같아요!
인준님이 물어보셨던 객체지향스럽게 짜는게 저런게 아닌가 생각이 들었어요! ㅋㅋㅋ

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아하 그쵸 맞아요 그랬던 기억이 쪼끔나서 여쭤봤었어요 ㅋㅋ

Comment on lines 53 to 61
log.info { "test!!: $userProfile" }
return UserProfileResponseDto(
userName = "테스트",
age = 20,
introduction = userProfile?.introduction,
profileSelect = userProfile?.profileSelect
).also {
log.info { "TEst! : $it" }
}
Copy link
Member

Choose a reason for hiding this comment

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

요건 나중에 회원 기능 구현하고 수정하시는거죠?-?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넵넵 맞습니다 주석 달아둘게요!

@injoon2019 injoon2019 merged commit 07fadb1 into develop Jul 23, 2024
1 check passed
@injoon2019 injoon2019 deleted the feature/19 branch July 23, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

내 프로필 조회하기 API 구현
2 participants