-
Notifications
You must be signed in to change notification settings - Fork 1
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
[BE] 회원가입 중복 확인 로그인 개인정보 조회 #62
Conversation
…lcss 회원가입 페이지 html css
- 서버 프로젝트 생성
- 프로젝트 기반 준비하기 - Lombok Setting - logback logging Setting - File 로 저장하기 - SignupApplication.java 에 로깅 테스트
Add: 프론트 자원 추가
- 배포 주소 추가
[FE] 로그인, 가입하기, 아이디, 이메일, 휴대전화 중복 체크
…erest 관심사 화면 및 기능 구현
…erest Add: 데모 영상 추가
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.
수고 많으셨습니다.
코멘트 드린 내용 참고해주세요.
# After new code Injection tools there's a generated folder /iOSInjectionProject | ||
# https://github.com/johnno1962/injectionforxcode | ||
|
||
<<<<<<< HEAD |
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.
파일에 conflict mark가 그대로 묻어있네요....
static final String USER_ID = "userId"; | ||
static final String PASSWORD = "password"; |
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
붙여주세요.
private UserRepository userRepository; | ||
|
||
@GetMapping | ||
public Object isDuplicate(String userId, String email, String phone) { |
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.
리턴타입으로 Object를 쓰는 건 자제해주세요.
throw new WrongFormatException(ErrorMessages.WRONG_FORMAT); | ||
} | ||
|
||
Optional<User> user = userRepository.findByPhoneNumber(phone); |
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.
단순히 전화번호 중복체크를 위해서 유저 전체를 받아오는 건 좋지 않아보이고요,
COUNT
쿼리 등을 사용하는 것으로 개선해보면 어떨까 생각이 드네요.
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.
|
||
Optional<User> user = userRepository.findByPhoneNumber(phone); | ||
|
||
if (user.isPresent()) |
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.
조건문에 중괄호 {
잊지 말아주세요.
} | ||
|
||
@ExceptionHandler(NotUniqueException.class) | ||
@ResponseStatus(HttpStatus.CONFLICT) |
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.
CONFLICT
는 흔하게 쓰지 않는 상태코드이긴 합니다만, 클라이언트 사이드와 협의가 잘 되었다면, 크게 상관은 없겠네요.
* Desc : userId, passwd 가 format 에 맞지 않다면 false 를 리턴합니다. | ||
* Return : boolean | ||
*/ | ||
public void checkValidUser() { |
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.
https://webcoding.tistory.com/entry/Spring-JSR-303-%EC%9C%BC%EB%A1%9C-%EA%B0%9D%EC%B2%B4-%EA%B0%92-%EA%B2%80%EC%A6%9D%ED%95%98%EA%B8%B0 참고하셔서 JSR-303 규격에 대해 한번 학습해보시고 다음부턴 적용해보세요.
log.debug("### isValidUser()"); | ||
|
||
if (!isCorrectUserIdFormat(userId)) { | ||
log.debug("### ERROR : isCorrectUserIdFormat"); |
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.
그리고 유저의 입력에 따라 좌우되는 값에 대해서 ERROR 라고 로깅하는 것은 좀 어색해 보입니다.
} | ||
|
||
public static boolean isCorrectInterestFormat(String interest) { | ||
if (interest == null) return false; |
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.
if문 블록이 한 줄이어도 꼭 중괄호 열어주시고, 줄바꿈 해주세요.
회원가입 기능 구현 및 컬렉션 셀 동적 사이즈 조정 기능 추가
수고하셨어요! |
회원가입, 개인정보조회
UserController
중복확인
로그인
API 정리 문서
https://documenter.getpostman.com/view/3004320/SzS8sk7n?version=latest