-
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
J01 8 be 회원 기능 #1
The head ref may contain hidden characters: "J01-8-be-\uD68C\uC6D0-\uAE30\uB2A5"
Conversation
이미지를 포함하는 엔티티 저장시 사용되는 클래스 추가
파일 서버 API 호출 클래스 추가
); | ||
} | ||
|
||
@PostMapping("/validations/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.
혹시 보통 validate
로 주변에서 많이 경로를 정했던 것 같은데 validations
로 경로를 결정한 이유가 있으신가요?
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.
동사대신 명사를 지향해서 이렇게 작명했습니다!
} | ||
|
||
@PutMapping("/nickname") | ||
public ResponseEntity<Void> updateProfileImage(@Authenticated final AuthPrincipal authPrincipal, |
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.
감사합니다!
return MemberLoginResponse.of(accessToken, member); | ||
} | ||
|
||
public void validateEmail(final MemberEmailValidateRequest request) { |
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.
아직 구현되지 않았습니다 ㅜㅜ 구현하려면 좀 복잡해서요...! 다음 스프린트에 개발할 예정입니다!
return; | ||
} | ||
|
||
if (memberRepository.existsByNickname(nickname)) { |
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.
혹시 equalsNickname()
이랑 existsByNickname()
닉네임 중복 검사를 2번 진행하는 이유가 있을까요?
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.
equalsNickname()
- 닉네임이 기존과 같은 경우 별도 Update 쿼리를 호출하지 않기 위해서입니다!
existsByNickname()
- 닉네임이 기존과 같은지 검증 후 닉네임 중복 여부를 확인하는 단계입니다!
memberRepository.save(member); | ||
} | ||
|
||
public Member findMemberById(final Long memberId) { |
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.
private
메서드로 정의해도 괜찮지 않을까요?
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.
헉 그렇네요! 감사합니다!
.orElseThrow(() -> NotFoundMemberException.createWhenInvalidMemberId(memberId)); | ||
} | ||
|
||
@Transactional |
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.
궁금증) @Transactional(readOnly = true)
어노테이션을 설정하고 또 @Transacton
어노테이션을 설정하는 이유가 있을까요?
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 OAuthLoginResponse login(final String providerType, final String code) { | ||
final SocialAccount socialAccount = oAuthClient.getProfile(providerType, code) | ||
.publishOn(Schedulers.boundedElastic()) |
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.
궁금증) 찾아보니까 publishOn
은 비동기 처리이고 block()
은 동기적으로 반환된다 이렇게 나와서 그런데 이렇게 사용하는 이유가 있을까요?
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.
publishOn()
은 별도 I/O 전용 스레드를 사용해서 메인 스레드 낭비를 줄일 수 있습니다! 비동기와는 관련 없는 걸로 알고있어요...!- 위 API 호출이 완료되어야 추가 작업(데이터 저장, 조회)을 할 수 있으므로
block()
(동기) 방식을 사용했습니다.
boolean existsBySocialAccountId(final Long socialAccountId); | ||
Optional<Member> findBySocialAccountId(final Long socialAccountId); | ||
|
||
@Query("SELECT NEW ject.componote.domain.auth.dao.MemberSummaryDao(m.nickname, m.profileImage) " + |
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라고 알고 있는데 dao로 정의한 이유가 있을까요?
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.
엔티티 데이터(VO 필드)를 가지고 있어 DAO로 작명했습니다! 데이터 전송보단 영속성 계층의 데이터를 가져올 때 사용되는 객체라 이렇게 작명했습니다!
작업 내용
FileService
추가Image
VO를 비동기(subscribe()
) 방식으로 경로 변경할 때 사용Member
에Image
VO 대신ProfileImage
사용테스트
Repository
Service
Controller
기타 사항 (참고 자료, 문의 사항 등)
소셜 로그인, 회원 가입, 로그인 플로우