-
Notifications
You must be signed in to change notification settings - Fork 0
이메일 인증 기능 구현 #9
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
이메일 인증 기능 구현 #9
Conversation
이번 머지에서는 Log 설정을 추가하여 로그 파일의 용량 최대치와 저장 형식등을 설정하였고 Github Action Workflow 들의 발동 조건이나 외부로 메세지 발송 시 형식을 조정하는 등의 수정을 하였습니다
| private final EmailVerificationPort emailVerificationPort; | ||
| private final JavaMailSender javaMailSender; | ||
|
|
||
| public EmailVerificationService(EmailVerificationPort emailVerificationPort, JavaMailSender javaMailSender) { |
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.
현재 생성자 주입을 사용하고 있는데, Lombok의 @RequiredArgsConstructor를 사용하시면 가독성과 유지보수 측면에서 더 좋을 것 같아요.
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.
피드백 반영 하였습니다.
리뷰 감사합니다!
| import com.ampersand.groom.domain.auth.application.service.EmailVerificationService; | ||
| import org.springframework.stereotype.Service; | ||
|
|
||
| @Service |
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를 사용하고 있는데, 만들어둔 @UseCaseWithReadOnlyTransaction이나 @UseCaseTransaction 어노테이션을 적용해보는건 어떤가요?
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.
@UseCaseTransaction 적용하여 피드백 반영하였습니다.
리뷰 감사합니다!
| @RequestMapping("/auth") | ||
| public class AuthController { | ||
|
|
||
| private final EmailVerificationUseCase emailVerificationUseCase; | ||
|
|
||
| public AuthController(EmailVerificationUseCase emailVerificationUseCase) { | ||
| this.emailVerificationUseCase = emailVerificationUseCase; | ||
| } | ||
|
|
||
| @PostMapping("/email/verify-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.
더 추가 할 기능이 없다면 @RequestMapping("/auth/email")이렇게 쓰셔도 좋을 것 같아요
그리고 API명세서에는 /email/signup 이런 식으로 되어있는데 확인해 보셔야 할 것 같아요
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.
수정한 API 명세서에 맞게 엔드포인트 수정하였습니다.
리뷰 감사합니다!
| //6자리 숫자 인증 코드 생성 | ||
| private String generateVerificationCode() { | ||
| Random random = new Random(); | ||
| int code = 10000000 + random.nextInt(90000000); | ||
| return String.valueOf(code); | ||
| } |
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.
8자리 숫자 인증 코드인데 맞나요?
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 ResponseEntity<?> verifyEmail(@RequestBody Map<String, Object> body) { | ||
| String code = (String) body.get("code"); | ||
|
|
||
| if (code == null || code.length() != 8) { |
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.
8이라는 숫자를 직접 하드코딩 하는 것보다
상수화시켜 사용해주시는 것이 더욱 명확하게 쓰임새도 알 수 있고 유지보수에도 좋을 것 같습니다
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 AuthController(EmailVerificationUseCase emailVerificationUseCase) { | ||
| this.emailVerificationUseCase = emailVerificationUseCase; | ||
| } |
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.
@RequiredArgsConstructor 어노테이션을 알아보고 한번 사용해보시면 좋을 것 같아요
보일러플레이트 코드를 줄일 수 있는 등의 장점이 있습니다
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.
@RequiredArgsConstructor 적용하여 피드백 반영 하였습니다.
리뷰 감사합니다!
snowykte0426
left a comment
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.
수고하셨습니다🙂
yena5511
left a comment
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.
수고하셨습니다!!
ta2ye0n
left a comment
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.
수고하셨습니다!
💡 PR 요약
POST /auth/email/verify-email엔드포인트를 통해 이메일 인증 코드 검증 기능을 구현하였습니다.POST /auth/email/signup엔드포인트를 통해 회원가입 인증 이메일 전송 기능을 구현하였습니다.POST /auth/email/refresh엔드포인트를 통해 비밀번호 변경 인증 이메일 전송 기능을 구현하였습니다.Resolves: [Feat]
email관련 기능 구현 #7📋 작업 내용
🤝 리뷰 시 참고사항
✅ 체크리스트
README,.env.example)