Conversation
Walkthrough장소 상세 조회 응답에 최신 리뷰 최대 3개를 포함하도록 변경되었습니다. 새로운 DTO Changes
Sequence DiagramsequenceDiagram
participant Client
participant PlaceService
participant PlaceRepository
participant PlaceReviewRepository
participant ImageUrlProvider
participant Database
Client->>PlaceService: getPlaceDetailsById(placeId)
PlaceService->>PlaceRepository: 조회 요청 (placeId)
PlaceRepository->>Database: SELECT place WHERE id=placeId
Database-->>PlaceRepository: Place 반환
PlaceRepository-->>PlaceService: Place 반환
PlaceService->>PlaceReviewRepository: 최신 3개 리뷰 조회 (placeId)
PlaceReviewRepository->>Database: SELECT ... ORDER BY createdAt DESC LIMIT 3
Database-->>PlaceReviewRepository: PlaceReview 목록 반환
PlaceReviewRepository-->>PlaceService: PlaceReview 목록 반환
PlaceService->>ImageUrlProvider: user.profileImageKey -> URL (for each review.user)
ImageUrlProvider-->>PlaceService: profileImageUrl 반환
PlaceService->>ImageUrlProvider: reviewImage.imageKey -> URL (for each image)
ImageUrlProvider-->>PlaceService: imageUrls 반환
PlaceService->>PlaceService: PlaceLatestReviewDto.from(...) 매핑 (리스트)
PlaceService->>PlaceService: PlaceDetailsGetResponse.of(..., latestReviews)
PlaceService-->>Client: PlaceDetailsGetResponse (latestReviews 포함)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/java/org/sopt/solply_server/domain/place/service/PlaceService.java`:
- Around line 90-95: The current code in PlaceService uses
placeReviewRepository.findAllByPlaceIdOrderByCreatedAtDesc(...).stream().limit(3)...
which fetches all reviews into memory; change this to query the DB for only
three rows by adding a repository method like
findTop3ByPlaceIdOrderByCreatedAtDesc(Long placeId) in PlaceReviewRepository and
call that from PlaceService instead of findAllByPlaceIdOrderByCreatedAtDesc,
then map the returned List<PlaceReview> to PlaceLatestReviewDto via
PlaceLatestReviewDto.from(review, imageUrlProvider).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: f663c477-d2b0-4b93-9e90-75aad57faf94
📒 Files selected for processing (3)
src/main/java/org/sopt/solply_server/domain/place/dto/PlaceLatestReviewDto.javasrc/main/java/org/sopt/solply_server/domain/place/dto/response/PlaceDetailsGetResponse.javasrc/main/java/org/sopt/solply_server/domain/place/service/PlaceService.java
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/org/sopt/solply_server/domain/place/service/PlaceService.java (1)
37-37: 🛠️ Refactor suggestion | 🟠 Major예외 타입을
BusinessException(ErrorCode)로 통일해 주세요.Line [116]에서
JwtTokenException을 던지고 있어 현재 저장소 예외 처리 규칙과 불일치합니다.🔧 제안 변경안
-import org.sopt.solply_server.global.exception.JwtTokenException; @@ - throw new JwtTokenException(ErrorCode.UNAUTHORIZED_USER); + throw new BusinessException(ErrorCode.UNAUTHORIZED_USER);As per coding guidelines
Use BusinessException(ErrorCode) with GlobalExceptionHandler for exception handling in Spring Boot.Also applies to: 115-116
🤖 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` at line 37, PlaceService currently throws JwtTokenException (import org.sopt.solply_server.global.exception.JwtTokenException) around the token check; replace that with throwing the unified BusinessException using an appropriate ErrorCode (e.g., throw new BusinessException(ErrorCode.INVALID_JWT) or ErrorCode.INVALID_TOKEN) from the same spot (method in PlaceService where JwtTokenException is thrown), and remove the JwtTokenException import; ensure the global exception handler will handle BusinessException as per project convention.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/main/java/org/sopt/solply_server/domain/place/service/PlaceService.java`:
- Line 37: PlaceService currently throws JwtTokenException (import
org.sopt.solply_server.global.exception.JwtTokenException) around the token
check; replace that with throwing the unified BusinessException using an
appropriate ErrorCode (e.g., throw new BusinessException(ErrorCode.INVALID_JWT)
or ErrorCode.INVALID_TOKEN) from the same spot (method in PlaceService where
JwtTokenException is thrown), and remove the JwtTokenException import; ensure
the global exception handler will handle BusinessException as per project
convention.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 250875cb-d574-482e-8db1-855dbb855942
📒 Files selected for processing (3)
src/main/java/org/sopt/solply_server/domain/place/service/PlaceService.javasrc/main/java/org/sopt/solply_server/domain/review/controller/PlaceReviewController.javasrc/main/java/org/sopt/solply_server/domain/review/repository/PlaceReviewRepository.java
✅ Files skipped from review due to trivial changes (1)
- src/main/java/org/sopt/solply_server/domain/review/controller/PlaceReviewController.java
🌳이슈 번호
resolves #358
☀️어떻게 이슈를 해결했나요?
🗯️ PR 포인트
테스팅 화면
Summary by CodeRabbit
새로운 기능
문서