-
Notifications
You must be signed in to change notification settings - Fork 10
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
[6주차 과제] 박해원 과제 제출합니다. #17
base: haewon
Are you sure you want to change the base?
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.
LGTM!!
잘했습니다!!일단 승인드릴테니 다음과제에 리뷰사항을 반영해주세요!!
@@ -27,6 +29,8 @@ public String create(MemberForm form) { | |||
Member member = new Member(); | |||
member.setName(form.getName()); | |||
memberService.join(member); | |||
member.setEmail(form.getEmail()); //추가 | |||
member.setPassword(form.getPassword()); |
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.
setter를 지양하는게 어떨까요? 지금 상태로는 생성자만으로 충분히 요구사항을 지킬 수 있을것 같습니다!!
//폼 데이터: 사용자가 HTML 폼을 통해 제출한 데이터, MemberForm은 사용자가 입력한 데이터를 담기위한 객체 | ||
//모델: 컨트롤러에서 처리된 결과를 뷰에 넘겨서 표시하기 위해 사용(사용자목록) | ||
@PostMapping(value = "/members/login") | ||
public String loginPost(MemberForm form, Model model){ |
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에서 비즈니스 로직을 수행합니다!!
@@ -11,6 +11,8 @@ public interface MemberRepository { | |||
|
|||
Optional<Member> findById(Long id); | |||
|
|||
Optional<Member> findByEmail(String email); |
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.
함수 추가 잘했어요!!
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.
하하하 감사함니다
@@ -28,4 +32,20 @@ public String getName() { | |||
public void setName(String name) { | |||
this.name = name; | |||
} | |||
|
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.
말했듯 최대한 setter를 지양하고 왜 setter를 지양하는지 찾아보세요!!
제 branch로 다시 올렸습니다!