-
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
Feat#50: user 프로필 조회 기능 구현 #51
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.
수고하셨습니당
User user = userRepository.findById(userId) | ||
.orElseThrow(() -> new UserException(UserExceptionErrorCode.USER_NOT_EXIST)); | ||
|
||
return new UserResponseDto(user.getName(), user.getEmail()); |
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.
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) |
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.
User user = userRepository.findById(userId)
.orElseThrow(() -> new UserException(UserExceptionErrorCode.USER_NOT_EXIST));
이 부분이 서비스 메서드마다 있는데, 하나의 메소드로 리팩토링해보는 건 어떨까요?
Resolves #50
Issue Define
Summary of resolutions or improvements
Note