Skip to content

[refactor] 리뷰 3개 초과 여부 boolean 추가#361

Merged
88guri merged 1 commit intodevelopfrom
refactor/#360/add-review-boolean
Apr 11, 2026
Merged

[refactor] 리뷰 3개 초과 여부 boolean 추가#361
88guri merged 1 commit intodevelopfrom
refactor/#360/add-review-boolean

Conversation

@88guri
Copy link
Copy Markdown
Contributor

@88guri 88guri commented Apr 11, 2026

🌳이슈 번호


resolves #360


☀️어떻게 이슈를 해결했나요?


  • 장소 상세 API에 최신 리뷰 리스트 응답 추가
  • Top4 조회 후 3개만 반환하도록 개선
  • hasMoreReviews 필드 추가로 추가 리뷰 존재 여부 제공

🗯️ PR 포인트

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요


테스팅 화면

image

Summary by CodeRabbit

릴리스 노트

  • 기능 개선
    • 장소 상세 정보 조회 시 추가 리뷰의 존재 여부를 표시하는 기능이 추가되었습니다.
    • 사용자는 더 많은 리뷰가 있는지 여부를 쉽게 확인할 수 있습니다.

@88guri 88guri self-assigned this Apr 11, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

Walkthrough

장소 상세 조회에 리뷰 개수 표시 기능을 추가합니다. 저장소에서 4개의 최신 리뷰를 조회하고, 3개를 초과하는 리뷰 존재 여부를 hasMoreReviews 플래그로 전달하도록 변경했습니다.

Changes

Cohort / File(s) Summary
응답 DTO 업데이트
src/main/java/org/sopt/solply_server/domain/place/dto/response/PlaceDetailsGetResponse.java
hasMoreReviews 불린 필드를 레코드 컴포넌트에 추가하고, 팩토리 메서드 of(...)의 서명을 확장하여 이 필드를 수용하도록 수정했습니다.
서비스 로직 수정
src/main/java/org/sopt/solply_server/domain/place/service/PlaceService.java
getPlaceDetailsById에서 저장소 쿼리를 통해 4개의 최신 리뷰를 조회하고, 3개 초과 여부를 판단한 후 hasMoreReviews 플래그를 응답에 포함시키도록 변경했습니다.
저장소 쿼리 업데이트
src/main/java/org/sopt/solply_server/domain/review/repository/PlaceReviewRepository.java
조회 리뷰 수를 상위 3개에서 상위 4개로 변경하여 초과 리뷰 존재 여부 판단을 지원합니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • uykm
  • leejisoo0617

Poem

🐰 네 개를 들어올리고 세 개를 보여주고,
더 있는지 물어보는 마법의 플래그,
리뷰의 깊이를 나타내는 작은 진실,
사용자들이 더 알고 싶을 때를 위해! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 PR의 주요 변경사항을 정확하게 반영하고 있습니다. boolean 필드 추가라는 핵심 내용을 명확히 전달합니다.
Linked Issues check ✅ Passed PR의 모든 코드 변경사항이 #360의 요구사항을 충족합니다. 3개 초과 여부를 나타내는 boolean hasMoreReviews 필드 추가 및 로직 구현이 완료되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 #360의 요구사항 범위 내에 있습니다. hasMoreReviews 필드 추가와 필요한 로직 수정만 포함되어 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/#360/add-review-boolean

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6b6e1f2 and 165468d.

📒 Files selected for processing (3)
  • src/main/java/org/sopt/solply_server/domain/place/dto/response/PlaceDetailsGetResponse.java
  • src/main/java/org/sopt/solply_server/domain/place/service/PlaceService.java
  • src/main/java/org/sopt/solply_server/domain/review/repository/PlaceReviewRepository.java

@88guri 88guri merged commit d6a6adb into develop Apr 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] 장소 상세에 리뷰 갯수 추가

1 participant