-
Notifications
You must be signed in to change notification settings - Fork 0
fix: 코드 오류 점검 #278
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
fix: 코드 오류 점검 #278
Conversation
Summary of ChangesHello @yongjun0511, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 주로 여러 컨트롤러에 걸쳐 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. API 문서 다듬고, 오류 명확히, 코드 개선, 부드러운 호출 기다려. Footnotes
|
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.
Code Review
이번 PR은 코드 오류 점검을 통해 API 명세(Swagger)를 개선하고 일부 로직 오류를 수정하는 내용을 담고 있습니다. 전반적으로 코드의 정확성과 명확성을 높이는 좋은 변경이라고 생각합니다.
다만, 몇 가지 개선점을 발견하여 리뷰 코멘트를 남겼습니다.
SliceService에서 스타일 가이드에 위배되는 와일드카드 import가 사용되었습니다.UserController의 닉네임 유효성 검사 및 수정 API에서 Swagger 문서의 오류 응답 코드가 실제 반환되는 값(400,409)과 다르게404로 잘못 기재되어 있습니다.
자세한 내용은 각 파일의 코멘트를 확인해주세요.
| @ApiResponse(responseCode = "404", description = "숫자로만 이루어진 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "연속된 공백을 포함하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "연속된 하이폰을 사용하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "첫 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "마지막 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "한글,영문,숫자,공백,하이폰(-)이외의 문자를 쓴 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "닉네임이 1자 이상 16이하가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "서비스명/브랜드명 단독 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "관리자로 혼동될 수 있는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "욕설/비속어가 이름에 포함되는 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))) |
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.
닉네임 유효성 검사 실패 시의 HTTP 상태 코드가 잘못 지정되었습니다. BaseResponseStatus에 정의된 바에 따르면, 닉네임 관련 유효성 오류는 400 Bad Request를 반환해야 합니다. 하지만 Swagger 문서에는 404 Not Found로 명시되어 있습니다. API 명세의 정확성을 위해 responseCode를 "400"으로 수정해야 합니다.
| @ApiResponse(responseCode = "404", description = "숫자로만 이루어진 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "연속된 공백을 포함하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "연속된 하이폰을 사용하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "첫 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "마지막 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "한글,영문,숫자,공백,하이폰(-)이외의 문자를 쓴 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "닉네임이 1자 이상 16이하가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "서비스명/브랜드명 단독 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "관리자로 혼동될 수 있는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "욕설/비속어가 이름에 포함되는 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))) | |
| @ApiResponse(responseCode = "400", description = "숫자로만 이루어진 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "연속된 공백을 포함하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "연속된 하이폰을 사용하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "첫 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "마지막 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "한글,영문,숫자,공백,하이폰(-)이외의 문자를 쓴 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "닉네임이 1자 이상 16이하가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "서비스명/브랜드명 단독 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "관리자로 혼동될 수 있는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "욕설/비속어가 이름에 포함되는 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))) |
| @ApiResponse(responseCode = "404", description = "숫자로만 이루어진 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "연속된 공백을 포함하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "연속된 하이폰을 사용하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "첫 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "마지막 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "한글,영문,숫자,공백,하이폰(-)이외의 문자를 쓴 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "닉네임이 1자 이상 16이하가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "서비스명/브랜드명 단독 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "관리자로 혼동될 수 있는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "욕설/비속어가 이름에 포함되는 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | ||
| @ApiResponse(responseCode = "404", description = "중복된 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))) |
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.
닉네임 수정 API의 오류 응답 상태 코드가 잘못 지정되었습니다.
- 닉네임 유효성 검사 실패 시에는
400 Bad Request를 반환해야 합니다. - 중복된 닉네임의 경우
BaseResponseStatus.DUPLICATE_NICKNAME에 따라409 Conflict를 반환해야 합니다.
현재 Swagger 문서에는 모두 404 Not Found로 명시되어 있어 API 명세가 부정확합니다. 올바른 상태 코드로 수정해주세요.
| @ApiResponse(responseCode = "404", description = "숫자로만 이루어진 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "연속된 공백을 포함하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "연속된 하이폰을 사용하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "첫 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "마지막 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "한글,영문,숫자,공백,하이폰(-)이외의 문자를 쓴 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "닉네임이 1자 이상 16이하가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "서비스명/브랜드명 단독 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "관리자로 혼동될 수 있는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "욕설/비속어가 이름에 포함되는 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "404", description = "중복된 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))) | |
| @ApiResponse(responseCode = "400", description = "숫자로만 이루어진 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "연속된 공백을 포함하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "연속된 하이폰을 사용하는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "첫 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "마지막 글자가 한글,영문,숫자가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "한글,영문,숫자,공백,하이폰(-)이외의 문자를 쓴 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "닉네임이 1자 이상 16이하가 아닌 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "서비스명/브랜드명 단독 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "관리자로 혼동될 수 있는 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "400", description = "욕설/비속어가 이름에 포함되는 경우", content = @Content(schema = @Schema(implementation = BaseResponse.class))), | |
| @ApiResponse(responseCode = "409", description = "중복된 닉네임", content = @Content(schema = @Schema(implementation = BaseResponse.class))) |
|
|
||
| import static ssu.eatssu.global.handler.response.BaseResponseStatus.NOT_FOUND_MENU; | ||
| import static ssu.eatssu.global.handler.response.BaseResponseStatus.NOT_FOUND_USER; | ||
| import static ssu.eatssu.global.handler.response.BaseResponseStatus.*; |
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.
와일드카드(*)를 사용한 import는 리포지토리 스타일 가이드에 위배됩니다.1 NOT_FOUND_MEAL이 추가되었으므로, 필요한 BaseResponseStatus만 명시적으로 import 하도록 수정해주세요.
| import static ssu.eatssu.global.handler.response.BaseResponseStatus.*; | |
| import static ssu.eatssu.global.handler.response.BaseResponseStatus.NOT_FOUND_MEAL; | |
| import static ssu.eatssu.global.handler.response.BaseResponseStatus.NOT_FOUND_MENU; | |
| import static ssu.eatssu.global.handler.response.BaseResponseStatus.NOT_FOUND_USER; |
Style Guide References
Footnotes
-
라이브러리를 import할 때 와일드카드를 사용하지 않아야 합니다. ↩
#️⃣ Issue Number
📝 요약(Summary)
💬 공유사항 to 리뷰어
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.