Skip to content

레벨2 코드리뷰 - 기술 매니저 #3

@zzangoobrother

Description

@zzangoobrother

안녕하세요. 과제 하시느라 수고 하셨습니다.

  1. if (jwtUtil.validateToken(token)) {
    // 토큰에서 사용자 정보 가져오기
    claims = jwtUtil.getUserInfoFromToken(token);
    }else {
    throw new IllegalArgumentException("Token Error");
    }

if else문은 가독성도 안좋고 하기에 if문 사용을 권장하고 꼭 사용해야할때 if else 문 사용하세요.

  1. Optional<User> found = userRepository.findByUsername(username);
    if (found.isPresent()) {
    throw new IllegalArgumentException("중복된 사용자가 존재합니다.");
    }

if문을 사용해서 회원존재 여부를 확인하는거 보다는 orElseThrow() 를 사용하시는게 가독성이 좋습니다.

다음 과제도 화이팅 하세요.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions