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 : Owner 회원가입 & 로그인 구현 #60

Merged
merged 26 commits into from
Jan 7, 2024
Merged

feat : Owner 회원가입 & 로그인 구현 #60

merged 26 commits into from
Jan 7, 2024

Conversation

kkangh00n
Copy link
Collaborator

@kkangh00n kkangh00n commented Jan 5, 2024

closed #17

⛏ 작업 상세 내용

  • Owner -> 인증 인가를 위한 UserDetails 상속 & email, password, role 필드 추가
  • DB에는 인코딩 된 비밀번호 저장
  • Owner 회원가입 & 로그인 로직 구현
  • 회원가입 성공 혹은 실패 테스트 케이스
  • 로그인 성공 혹은 실패 테스트 케이스

📝 작업 요약

  • Owner 회원가입
  • Owner 로그인
  • 테스트 코드

☑️ 중점적으로 리뷰 할 부분

  • 추가적인 테스트 케이스 있을지
  • 네이밍

@kkangh00n kkangh00n linked an issue Jan 5, 2024 that may be closed by this pull request
3 tasks
@kkangh00n kkangh00n self-assigned this Jan 5, 2024
Copy link

github-actions bot commented Jan 5, 2024

Test Results

79 tests  +10   79 ✅ +10   22s ⏱️ +5s
22 suites + 2    0 💤 ± 0 
22 files   + 2    0 ❌ ± 0 

Results for commit 4b756c2. ± Comparison against base commit 5779770.

♻️ This comment has been updated with latest results.

Copy link
Member

@dlswns2480 dlswns2480 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~! 통합테스트 시 에러발생에 대한 테스트를 한다면 에러메세지 검증까지는 하는 것도 좋을 것 같아요 😃

Copy link
Member

@hyun2371 hyun2371 left a comment

Choose a reason for hiding this comment

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

로직 구현하느라 고생많으셨습니다~

public record JoinOwnerRequest(

String name,
@Email
Copy link
Member

Choose a reason for hiding this comment

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

message 옵션으로 검증 메세지를 추가해줘도 좋을 것 같아요!


ALREADY_EXIST_OWNER("이미 존재하는 점주입니다"),
BAD_REQUEST_EMAIL_OR_PASSWORD("이메일 혹은 비밀번호를 확인해주세요"),
BAD_REQUEST_INPUT_GENDER_TYPE("성별 타입을 양식대로 입력해주세요");

Copy link
Member

Choose a reason for hiding this comment

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

BadRequestCustomException으로 감싸주니까 INVALID_EMAIL_OR_PASSWORD 이렇게 네이밍해도 괜찮지 않을까 생각이 들었습니다!

.filter(gender -> gender.isEqual(input))
.findAny()
.orElseThrow(() -> new BadRequestCustomException(BAD_REQUEST_INPUT_GENDER_TYPE));
}
Copy link
Member

Choose a reason for hiding this comment

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

request에서 검증하지 않고 Enum에서 input을 검증하면 캡슐화의 장점이 있는건지 궁금합니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Enum으로의 변환로직? 이라고 생각할 때, request dto보다는 Enum 안에서 따로 로직이 있어야 된다고 생각하였습니다..!

String email = "abc1234@gmail.com";
String password = "qwer1234";
String wrongPassword = "qwer12345";

Copy link
Member

Choose a reason for hiding this comment

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

private final 붙여도 될 것 같아요~

@kkangh00n kkangh00n merged commit 6fa48fc into dev Jan 7, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature : Owner 로그인 로직 구현
3 participants