Conversation
WalkthroughThis change updates three ArticleController endpoint paths and one parameter binding, and adds spring.jpa.open-in-view: false to application.yml. No method signatures or return types changed. No other files or properties were modified. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Controller as ArticleController
participant Service as ArticleService
participant Repo as ArticleRepository
rect rgb(240,248,255)
note over Client,Controller: Updated endpoint paths and param binding
Client->>Controller: GET /api/articles/saved?url=...
Controller->>Service: checkArticleExists(url)
Service->>Repo: findByUrl(url)
Repo-->>Service: Article?
Service-->>Controller: boolean
Controller-->>Client: 200 OK (boolean)
end
rect rgb(245,255,240)
Client->>Controller: GET /api/articles/category?categoryId=...
note right of Controller: categoryId now via RequestParam
Controller->>Service: getAllByCategory(categoryId)
Service->>Repo: findAllByCategoryId(categoryId)
Repo-->>Service: List<Article>
Service-->>Controller: List<ArticleDto>
Controller-->>Client: 200 OK (list)
end
rect rgb(255,250,240)
Client->>Controller: PUT /api/articles/{articleId}/readStatus
Controller->>Service: updateReadStatus(articleId)
Service->>Repo: update/read flag
Repo-->>Service: status
Service-->>Controller: status/result
Controller-->>Client: 200 OK
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
api/src/main/java/com/pinback/api/article/controller/ArticleController.java (1)
127-134: Use PATCH to match the spec for read status updates.Spec says
PATCH /articles/{articleId}/readStatus; switch mapping to PATCH for semantic and contract alignment.- @PutMapping("/{articleId}/readStatus") + @PatchMapping("/{articleId}/readStatus") public ResponseDto<ReadArticleResponse> updateArticleStatus(Add import (outside this hunk):
import org.springframework.web.bind.annotation.PatchMapping;
🧹 Nitpick comments (1)
api/src/main/java/com/pinback/api/article/controller/ArticleController.java (1)
69-76: GET /saved: enforce required query param and validate URL.Make the
urlparam explicitly required at mapping time and validate input.- @GetMapping("/saved") + @GetMapping(value = "/saved", params = "url") public ResponseDto<ArticleDetailResponse> checkArticleExists( @Parameter(hidden = true) @CurrentUser User user, - @Parameter(description = "확인할 URL") @RequestParam String url + @Parameter(description = "확인할 URL", required = true) @RequestParam @NotBlank String url ) {Add imports (outside this hunk):
import jakarta.validation.constraints.NotBlank;If you add parameter constraints, annotate the class with
@Validated:import org.springframework.validation.annotation.Validated; @Validated @RestController @RequestMapping("/api/v1/articles") @RequiredArgsConstructor @Tag(name = "Article", description = "아티클 관리 API") public class ArticleController { ... }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
api/src/main/java/com/pinback/api/article/controller/ArticleController.java(3 hunks)api/src/main/resources/application.yml(1 hunks)
🔇 Additional comments (2)
api/src/main/resources/application.yml (1)
11-11: No action needed. Controllers don’t return JPA entities and all read-only service methods are annotated with@Transactional(readOnly = true), so disabling OSIV is safe.api/src/main/java/com/pinback/api/article/controller/ArticleController.java (1)
91-101: Enforce required param and validate/categoryendpoint
- Update mapping:
- @GetMapping("/category") + @GetMapping(value = "/category", params = "categoryId")- Validate input:
Add- @Parameter(description = "카테고리 ID") @RequestParam Long categoryId + @Parameter(description = "카테고리 ID", required = true) @RequestParam @Positive Long categoryIdimport jakarta.validation.constraints.Positive;- No internal
/category/{categoryId}mappings or docs found; manually verify external clients aren’t relying on the old path-param route.
🚀 PR 요약
명세서와 다른 부분을 맞추고 OSIV 설정을 진행했습니다.
close #93
✨ PR 상세 내용
아래와 같은 부분을 수정했습니다.
추가적으로 OSIV 설정을 false로 설정했습니다.
🚨 주의 사항
없습니다
✅ 체크 리스트
Summary by CodeRabbit