Merged
Conversation
Walkthrough장소 상세 조회에 리뷰 개수 표시 기능을 추가합니다. 저장소에서 4개의 최신 리뷰를 조회하고, 3개를 초과하는 리뷰 존재 여부를 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/java/org/sopt/solply_server/domain/place/service/PlaceService.java (1)
94-98: 매직 넘버(3)만 상수로 분리하면 유지보수성이 더 좋아집니다.동일 임계값이 두 곳에서 사용되어 있어 한 곳으로 모아두면 추후 변경 시 안전합니다.
♻️ 제안 diff
public class PlaceService { + private static final int LATEST_REVIEW_VISIBLE_LIMIT = 3; public PlaceDetailsGetResponse getPlaceDetailsById(final Long userId, final Long placeId) { @@ - boolean hasMoreReviews = reviews.size() > 3; + boolean hasMoreReviews = reviews.size() > LATEST_REVIEW_VISIBLE_LIMIT; List<PlaceLatestReviewDto> latestReviews = reviews.stream() - .limit(3) + .limit(LATEST_REVIEW_VISIBLE_LIMIT) .map(review -> PlaceLatestReviewDto.from(review, imageUrlProvider)) .toList();🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/java/org/sopt/solply_server/domain/place/service/PlaceService.java` around lines 94 - 98, The code uses the magic number 3 in two places (hasMoreReviews and the stream().limit call) which hurts maintainability; define a single constant (e.g., private static final int LATEST_REVIEW_LIMIT = 3) near the top of PlaceService and replace both occurrences (the hasMoreReviews calculation and the .limit(3) call used when building latestReviews via PlaceLatestReviewDto.from) with that constant so future changes require updating only one value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/main/java/org/sopt/solply_server/domain/place/service/PlaceService.java`:
- Around line 94-98: The code uses the magic number 3 in two places
(hasMoreReviews and the stream().limit call) which hurts maintainability; define
a single constant (e.g., private static final int LATEST_REVIEW_LIMIT = 3) near
the top of PlaceService and replace both occurrences (the hasMoreReviews
calculation and the .limit(3) call used when building latestReviews via
PlaceLatestReviewDto.from) with that constant so future changes require updating
only one value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 44f1c255-a984-4883-9e51-d9d828d09737
📒 Files selected for processing (3)
src/main/java/org/sopt/solply_server/domain/place/dto/response/PlaceDetailsGetResponse.javasrc/main/java/org/sopt/solply_server/domain/place/service/PlaceService.javasrc/main/java/org/sopt/solply_server/domain/review/repository/PlaceReviewRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌳이슈 번호
resolves #360
☀️어떻게 이슈를 해결했나요?
🗯️ PR 포인트
테스팅 화면
Summary by CodeRabbit
릴리스 노트