-
Notifications
You must be signed in to change notification settings - Fork 11
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
권세빈 2주차 과제 #6
base: main
Are you sure you want to change the base?
권세빈 2주차 과제 #6
Conversation
// TODO : 로그인을 진행한다. | ||
public AuthLoginResponse login(AuthLoginRequest request) { | ||
// DB에서 memberLoginId와 memberPassword를 조회하여 일치하는 회원이 있는지 확인한다. | ||
Member member = memberRepository.findByMemberLoginIdAndMemberPassword( | ||
request.getMemberLoginId(), request.getMemberPassword()); | ||
|
||
// 만약 일치하는 회원이 없다면, IllegalArgumentException을 발생시킨다. | ||
if (member == null) { | ||
throw new IllegalArgumentException("아이디 또는 비밀번호가 일치하지 않습니다."); | ||
} | ||
|
||
// 일치하는 회원이 있다면, MemberResponse로 변환하여 반환한다. | ||
return null; | ||
// 일치하는 회원이 있다면, AuthLoginResponse로 변환하여 반환한다. | ||
return AuthLoginResponse.from(member); | ||
} |
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.
굿굿입니다!
public void updateName(String newName) { | ||
if (newName == null || newName.trim().isEmpty()) { | ||
throw new IllegalArgumentException("이름은 비어있을 수 없습니다."); | ||
} | ||
this.memberName = newName; | ||
} | ||
} |
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.
wow trim까지.. 좋습니다!!
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.
너무 깔끔하게 잘 해주셨씁니다! 수고하셨습니다
비밀번호에서 @를 뺏습니당