Skip to content

Conversation

@jsoonworld
Copy link
Member

📄 Work Description

  • UserName VO에서 null 검증 메서드 이름을 validateNullvalidateNotNull로 변경하여 메서드 역할을 명확히 했습니다.
  • UserErrorCode의 에러 메시지를 상황에 맞게 개선했습니다.
    • 형식 오류 → "이름은 한글, 영어, 숫자, 공백으로만 구성할 수 있습니다."

💬 To Reviewers

  • null 검증 자체는 기존과 동일하며, 메서드 명을 의미에 맞게 변경했습니다.
  • 가독성 측면이나 메시지 표현 방식에서 더 나은 방향이 있다면 피드백 부탁드립니다 🙏

📷 Screenshot

스크린샷 2025-03-27 오후 1 01 50

⚙️ ISSUE

✅ PR check list

  • Reviewers
  • Assignees
  • Labels

BaseException과 Exception 처리만으로 충분하므로,
UnsupportedOperationException, HttpMediaTypeNotSupportedException,
SocketTimeoutException에 대한 별도 핸들러를 제거함.
- INVALID_USER_NAME 메시지에 공백 허용 여부를 명확히 표현
@jsoonworld jsoonworld added ♻️ refactor 코드 리팩토링 ex) 형식변경 🦊장순🦊 labels Mar 27, 2025
@jsoonworld jsoonworld self-assigned this Mar 27, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the user name validation logic and improves error messaging, along with cleaning up unused exception handlers.

  • Renamed the null validation method from validateNull to validateNotNull and reordered validation steps.
  • Updated the error message for invalid user name format to include the allowance of whitespace.
  • Removed redundant exception handler methods from the global exception handler file.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/main/java/org/terning/user/domain/vo/UserName.java Renamed the null check method to validateNotNull and reordered validation calls.
src/main/java/org/terning/user/common/failure/UserErrorCode.java Updated the error message to clearly indicate allowed characters (including whitespace).
src/main/java/org/terning/global/failure/GlobalExceptionHandler.java Removed unused exception handlers for unsupported operations, media type, and socket timeout.

USER_NAME_NOT_NULL(HttpStatus.BAD_REQUEST, "이름은 null일 수 없습니다."),
USER_NAME_LENGTH_EXCEEDED(HttpStatus.BAD_REQUEST, "이름은 공백 포함 12글자를 넘을 수 없습니다."),
INVALID_USER_NAME(HttpStatus.BAD_REQUEST, "이름의 구성은 문자(한글, 영어), 숫자만 가능합니다."),
INVALID_USER_NAME(HttpStatus.BAD_REQUEST, "이름은 한글, 영어, 숫자, 공백으로만 구성할 수 있습니다."),
Copy link
Contributor

Choose a reason for hiding this comment

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

공백이 추가되었네요!!! 확실하게 의미를 전달할 수 있는 것 같아 좋은 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

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

피드백 반영하여 공백을 포함한 조건으로 수정하였습니다! 덕분에 의미를 더 명확하게 전달할 수 있게 된 것 같아요.

감사합니다 😊

Comment on lines +34 to 35
validateNotNull(value);
validateInvalidCharacters(value);
Copy link
Contributor

Choose a reason for hiding this comment

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

디테일한 네이밍 센스... 너무 좋습니다

Copy link
Member Author

Choose a reason for hiding this comment

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

피드백 덕분에 네이밍에도 더 신경 쓸 수 있었던 것 같아요!

감사합니다 🙏

@jsoonworld jsoonworld merged commit e18e320 into develop Mar 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ refactor 코드 리팩토링 ex) 형식변경 size/M 🦊장순🦊

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[♻️ refactor] UserName 검증 개선

3 participants