Skip to content

Conversation

@yongjun0511
Copy link
Collaborator

#️⃣ Issue Number

📝 요약(Summary)

  • V2 API에서 별점 입력값 범위에 대한 검증 로직을 추가했습니다.

💬 공유사항 to 리뷰어

✅ PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

@yongjun0511 yongjun0511 self-assigned this Oct 1, 2025
@yongjun0511 yongjun0511 added the fix 고치기 label Oct 1, 2025
@yongjun0511 yongjun0511 linked an issue Oct 1, 2025 that may be closed by this pull request
@gemini-code-assist
Copy link

Summary of Changes

Hello @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은 V2 API의 리뷰 생성 기능에 대한 입력값 유효성 검증을 강화합니다. 식단 및 메뉴 리뷰의 평점 필드에 1부터 5까지의 범위 제한을 두어, 잘못된 평점 입력으로 인한 오류를 방지하고 데이터의 무결성을 확보하는 것이 주된 목적입니다. 이를 통해 API의 안정성과 신뢰성을 향상시킵니다.

Highlights

  • V2 API 리뷰 평점 유효성 검증 추가: 식단 및 메뉴 리뷰 생성 요청 시 평점 입력값(1~5)에 대한 유효성 검증 로직을 추가했습니다.
  • @Valid 어노테이션 적용: 컨트롤러 계층에서 DTO의 유효성 검증을 활성화하기 위해 @Valid 어노테이션을 추가했습니다.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.


입력값 검증 오류 막아 안정성 코드의 방패

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@yongjun0511 yongjun0511 merged commit 1934cba into develop Oct 1, 2025
@yongjun0511 yongjun0511 deleted the fix/#255-review-zero-stars branch October 1, 2025 13:33
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

V2 API의 리뷰 별점 입력값에 대한 검증 로직을 추가하여 API 안정성과 데이터 무결성을 높인 좋은 변경입니다. 다만, 몇 가지 개선점을 제안합니다. 각 DTO의 @Min, @Max 어노테이션에 message 속성을 추가하여 유효성 검증 실패 시 더 명확한 에러 메시지를 사용자에게 반환하는 것을 권장합니다. 또한, CreateMenuReviewRequest에서는 별점을 1점에서 5점으로 제한했지만, Ratings 클래스에서는 0점에서 5점으로 검증하고 있어 불일치가 존재합니다. 도메인 모델의 불변성이 API 계약과 일치하도록 Ratings 클래스의 검증 로직도 1점에서 5점으로 수정하여 일관성을 유지하는 것을 고려해보시는 것이 좋겠습니다.

Comment on lines +23 to +24
@Min(1)
@Max(5)

Choose a reason for hiding this comment

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

medium

유효성 검증 실패 시 더 명확한 에러 메시지를 제공하기 위해 @Min@Max 어노테이션에 message 속성을 추가하는 것이 좋습니다. 예를 들어, '별점은 1점에서 5점 사이여야 합니다.'와 같은 메시지를 반환할 수 있습니다.

Suggested change
@Min(1)
@Max(5)
@Min(value = 1, message = "별점은 1점 이상이어야 합니다.")
@Max(value = 5, message = "별점은 5점 이하여야 합니다.")

Comment on lines +23 to +24
@Min(1)
@Max(5)

Choose a reason for hiding this comment

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

medium

유효성 검증 실패 시 더 명확한 에러 메시지를 제공하기 위해 @Min@Max 어노테이션에 message 속성을 추가하는 것이 좋습니다. 예를 들어, '메인 별점은 1점에서 5점 사이여야 합니다.'와 같은 메시지를 반환할 수 있습니다.

Suggested change
@Min(1)
@Max(5)
@Min(value = 1, message = "메인 별점은 1점 이상이어야 합니다.")
@Max(value = 5, message = "메인 별점은 5점 이하여야 합니다.")

Comment on lines +27 to +28
@Min(1)
@Max(5)

Choose a reason for hiding this comment

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

medium

유효성 검증 실패 시 더 명확한 에러 메시지를 제공하기 위해 @Min@Max 어노테이션에 message 속성을 추가하는 것이 좋습니다. 예를 들어, '양 별점은 1점에서 5점 사이여야 합니다.'와 같은 메시지를 반환할 수 있습니다.

Suggested change
@Min(1)
@Max(5)
@Min(value = 1, message = "양 별점은 1점 이상이어야 합니다.")
@Max(value = 5, message = "양 별점은 5점 이하여야 합니다.")

Comment on lines +31 to +32
@Min(1)
@Max(5)

Choose a reason for hiding this comment

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

medium

유효성 검증 실패 시 더 명확한 에러 메시지를 제공하기 위해 @Min@Max 어노테이션에 message 속성을 추가하는 것이 좋습니다. 예를 들어, '맛 별점은 1점에서 5점 사이여야 합니다.'와 같은 메시지를 반환할 수 있습니다.

Suggested change
@Min(1)
@Max(5)
@Min(value = 1, message = "맛 별점은 1점 이상이어야 합니다.")
@Max(value = 5, message = "맛 별점은 5점 이하여야 합니다.")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 고치기

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: 리뷰 별점 0점 제한

2 participants