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

[BE] 회원가입 중복 확인 로그인 개인정보 조회 #62

Closed
wants to merge 167 commits into from

Conversation

moonelysian
Copy link
Contributor

@moonelysian moonelysian commented Mar 27, 2020

  • 회원가입, 개인정보조회
    UserController

  • 중복확인

    • DuplicateController
  • 로그인

    • AuthController

API 정리 문서

https://documenter.getpostman.com/view/3004320/SzS8sk7n?version=latest

delmaSong and others added 30 commits March 22, 2020 13:51
- 서버 프로젝트 생성
- 프로젝트 기반 준비하기
  - Lombok Setting
  - logback logging Setting
    - File 로 저장하기
    - SignupApplication.java 에 로깅 테스트
Copy link

@wheejuni wheejuni left a 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

Choose a reason for hiding this comment

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

파일에 conflict mark가 그대로 묻어있네요....

Comment on lines +21 to +22
static final String USER_ID = "userId";
static final String PASSWORD = "password";

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) {

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);

Choose a reason for hiding this comment

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

단순히 전화번호 중복체크를 위해서 유저 전체를 받아오는 건 좋지 않아보이고요,
COUNT 쿼리 등을 사용하는 것으로 개선해보면 어떨까 생각이 드네요.

Copy link

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())

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)

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() {

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");

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;

Choose a reason for hiding this comment

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

if문 블록이 한 줄이어도 꼭 중괄호 열어주시고, 줄바꿈 해주세요.

@honux77
Copy link

honux77 commented Apr 7, 2020

수고하셨어요!

@honux77 honux77 closed this Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants