Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new GET /posts/{postId}/summary endpoint across API, controller, and service layers to return a single Callvan post summary and mark isJoined for the requesting user. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant API as CallvanApi
participant Controller as CallvanController
participant Service as CallvanPostQueryService
participant Repo as CallvanPostRepository
Client->>API: GET /posts/{postId}/summary (userId)
API->>Controller: forward request
Controller->>Service: getCallvanPostSummary(postId, userId)
Service->>Repo: find post by postId
Repo-->>Service: post entity
Service->>Repo: check participation (postId, userId)
Repo-->>Service: participation exists? (bool)
Service-->>Controller: CallvanPostResponse(post, isJoined, userId)
Controller-->>API: ResponseEntity<CallvanPostResponse>
API-->>Client: 200 OK / 404 Not Found
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 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 unit tests (beta)
📝 Coding Plan
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 Tip You can enable review details to help with troubleshooting, context usage and more.Enable the |
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/in/koreatech/koin/domain/callvan/service/CallvanPostQueryService.java`:
- Around line 119-123: In getCallvanPostSummary, avoid passing a nullable userId
into callvanParticipantRepository.existsByPostIdAndMemberIdAndIsDeletedFalse;
instead, short-circuit when userId is null by setting isJoined = false,
otherwise call existsByPostIdAndMemberIdAndIsDeletedFalse(postId, userId). Keep
the CallvanPost retrieval (callvanPostRepository.getById(postId)) unchanged and
pass the computed isJoined and userId into
CallvanPostSearchResponse.CallvanPostResponse.from.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 00d41393-de5c-4b37-baf8-08a19c87ac28
📒 Files selected for processing (3)
src/main/java/in/koreatech/koin/domain/callvan/controller/CallvanApi.javasrc/main/java/in/koreatech/koin/domain/callvan/controller/CallvanController.javasrc/main/java/in/koreatech/koin/domain/callvan/service/CallvanPostQueryService.java
src/main/java/in/koreatech/koin/domain/callvan/service/CallvanPostQueryService.java
Show resolved
Hide resolved
| 1. 존재하지 않는 게시글(`NOT_FOUND_ARTICLE`)이면 예외가 발생합니다. | ||
| 2. 로그인된 사용자의 경우, 해당 콜벤 게시글에 합류한 상태면 `isJoined` 필드가 true로 표시됩니다. | ||
| """) | ||
| @GetMapping("/posts/{postId}/summary") |
There was a problem hiding this comment.
| @GetMapping("/posts/{postId}/summary") | |
| @GetMapping("/posts/{postId}") |
이런 식으로 하지 않은 이유가 궁금합니당 👀
There was a problem hiding this comment.
@GetMapping("/posts/{postId}")
public ResponseEntity<CallvanPostDetailResponse> getCallvanPostDetail(
@PathVariable Integer postId,
@UserId Integer userId
)
다른 API에서 쓰고 있어요 ㅠ
🔍 개요
🚀 주요 변경 내용
💬 참고 사항
✅ Checklist (완료 조건)
Summary by CodeRabbit