-
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
[#5] DB연동 및 docker-compose 적용 #6
base: develop
Are you sure you want to change the base?
Conversation
if (userRepository.findByEmail(user.getEmail()).isPresent()) { | ||
throw new IllegalArgumentException("이메일 중복"); | ||
} |
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.
if (userRepository.findByEmail(user.getEmail()).isPresent()) { | |
throw new IllegalArgumentException("이메일 중복"); | |
} | |
Stream.of(user.getEmail()) | |
.map(userRepository::findByEmail) | |
.getOrElse(() => throw new IllegalArgumentException("이메일 중복")) | |
.collect(); |
if (userRepository.findByEmail(user.getEmail()).isPresent()) { | |
throw new IllegalArgumentException("이메일 중복"); | |
} | |
userRepository | |
.findByEmail(user.getEmail()) | |
.getOrElse(() => throw new IllegalArgumentException("이메일 중복")); |
|
||
public LoginResponseDto createUser(SignUpRequestDto request) { | ||
User user = request.toDomain(); | ||
if (userRepository.findByEmail(user.getEmail()).isPresent()) { |
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.
if (userRepository.findByEmail(user.getEmail()).isPresent()) { | |
if (userRepository.findByEmail(user.getEmail()) == null) { |
if (userRepository.findByEmailAndPassword(user.getEmail(), user.getPassword()).isEmpty()) { | ||
throw new IllegalArgumentException("로그인 정보가 올바르지 않습니다."); | ||
} | ||
return LoginResponseDto.of(user, "asdf"); |
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.
Service에서 DTO를 알고 있는 것이 좋은 것인가요?
@@ -14,4 +16,8 @@ public class SignUpRequestDto { | |||
private String email; | |||
@Schema(description = "사용자 비밀번호") | |||
private String password; | |||
|
|||
public User toDomain() { |
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.
DTO안에 비지니스 로직이 들어가는 것이 좋은 것인가요?
해결하려는 문제
변경 사항
참고 사항
CheckList