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

Feat#50: user 프로필 조회 기능 구현 #51

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Conversation

pkl0912
Copy link
Contributor

@pkl0912 pkl0912 commented Oct 18, 2024

Resolves #50

Issue Define

  • 사용자 이름과 이메일을 가져옵니다

Summary of resolutions or improvements

image

Note

@auto-assign auto-assign bot requested a review from yeonjookang October 18, 2024 03:08
@pkl0912 pkl0912 changed the title feat: user 프로필 조회 기능 구현 Fea#50t: user 프로필 조회 기능 구현 Oct 18, 2024
@github-actions github-actions bot added the feat 기능 개발 label Oct 18, 2024
Copy link
Contributor

@yeonjookang yeonjookang left a comment

Choose a reason for hiding this comment

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

수고하셨습니당

User user = userRepository.findById(userId)
.orElseThrow(() -> new UserException(UserExceptionErrorCode.USER_NOT_EXIST));

return new UserResponseDto(user.getName(), user.getEmail());
Copy link
Contributor

Choose a reason for hiding this comment

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

Response는 만들어놓은 Builder를 사용해도 될 것 같아요!

User user = userRepository.findById(userId)
.orElseThrow(() -> new UserException(UserExceptionErrorCode.USER_NOT_EXIST));

// name 업데이트
user.changeName(newName);
}
@Transactional(readOnly = true)
public UserResponseDto getUserNameAndEmailById(Long userId) {
User user = userRepository.findById(userId)
Copy link
Contributor

Choose a reason for hiding this comment

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

User user = userRepository.findById(userId)
.orElseThrow(() -> new UserException(UserExceptionErrorCode.USER_NOT_EXIST));
이 부분이 서비스 메서드마다 있는데, 하나의 메소드로 리팩토링해보는 건 어떨까요?

@yeonjookang yeonjookang changed the title Fea#50t: user 프로필 조회 기능 구현 Fea#50: user 프로필 조회 기능 구현 Oct 18, 2024
@pkl0912 pkl0912 merged commit 6cdab87 into dev Oct 18, 2024
2 checks passed
@pkl0912 pkl0912 deleted the feat/get-mypage branch October 18, 2024 03:43
@pkl0912 pkl0912 changed the title Fea#50: user 프로필 조회 기능 구현 Feat#50: user 프로필 조회 기능 구현 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: 마이페이지 조회
2 participants