Skip to content

refactor: 기존 명세서와 구현 통합 및 OSIV 설정 #94

Merged
rootTiket merged 3 commits intodevfrom
refactor/#93
Sep 4, 2025
Merged

refactor: 기존 명세서와 구현 통합 및 OSIV 설정 #94
rootTiket merged 3 commits intodevfrom
refactor/#93

Conversation

@rootTiket
Copy link
Contributor

@rootTiket rootTiket commented Sep 4, 2025

🚀 PR 요약

명세서와 다른 부분을 맞추고 OSIV 설정을 진행했습니다.

close #93

✨ PR 상세 내용

아래와 같은 부분을 수정했습니다.

GET /articles/saved?url= - 아티클 저장 여부 조회

실제로는 GET /api/v1/articles/check 로 구현됨


GET /articles/category?categoryId=&page=&size= - 카테고리별 아티클 조회

실제로는 GET /api/v1/articles/category/{categoryId} 로 구현됨


PATCH /aritcles/{articleId}/readStatus - 아티클 읽음 표시 변경

실제로는 PUT /api/v1/articles/{articleId}/read 로 구현됨


PATCH /articles/{articleId} - 아티클 수정

실제로는 PUT /api/v1/articles/{articleId} 로 구현됨


PATCH /categories/{categoryId} - 카테고리 수정

실제로는 PUT /api/v1/categories/{categoryId} 로 구현됨

추가적으로 OSIV 설정을 false로 설정했습니다.

🚨 주의 사항

없습니다

✅ 체크 리스트

  • 리뷰어 설정했나요?
  • Label 설정했나요?
  • 제목 양식 맞췄나요? (ex. feat: 기능 추가)
  • 변경 사항에 대한 테스트를 진행했나요?

Summary by CodeRabbit

  • Refactor
    • Updated article API endpoints:
      • Existence check: /saved replaces /check.
      • Category listing: /category now takes categoryId as a query parameter (?categoryId=) instead of a path segment.
      • Read status: /{articleId}/readStatus replaces /{articleId}/read.
    • No changes to response formats or behavior—only URL paths and parameter location updated. Please update client integrations accordingly.

@coderabbitai
Copy link

coderabbitai bot commented Sep 4, 2025

Walkthrough

This 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

Cohort / File(s) Summary of Changes
API endpoint path updates
api/src/main/java/com/pinback/api/article/controller/ArticleController.java
Updated mappings: /check/saved for existence check; /category/{categoryId}/category with @PathVariable@RequestParam Long categoryId; /{articleId}/read/{articleId}/readStatus. No return type or method signature changes.
JPA configuration
api/src/main/resources/application.yml
Added spring.jpa.open-in-view: false under spring.jpa. No other configuration 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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A hop, a skip, new paths I tread,
From /check to /saved, I bound ahead.
I nibble params—now query-fed,
ReadStatus carrots neatly spread.
With JPA’s view now tucked to bed,
I thump the ground: “Routes updated!” 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#93

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@ose0221 ose0221 left a comment

Choose a reason for hiding this comment

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

확인했습니다.

@rootTiket rootTiket merged commit a2cf93e into dev Sep 4, 2025
4 of 5 checks passed
@rootTiket rootTiket deleted the refactor/#93 branch September 4, 2025 14:42
Copy link

@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.

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 url param 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 40f29bc and bfd8051.

📒 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 /category endpoint

  • Update mapping:
    - @GetMapping("/category")
    + @GetMapping(value = "/category", params = "categoryId")
  • Validate input:
    - @Parameter(description = "카테고리 ID") @RequestParam Long categoryId
    + @Parameter(description = "카테고리 ID", required = true) @RequestParam @Positive Long categoryId
    Add import 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.

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] notion 명세서와 리펙토링 결과물 결과 통합

2 participants