Skip to content

refactor/물주기 햇빛주기 에러 수정#142

Merged
c5ln merged 2 commits into
developfrom
refactor/물주기-햇빛주기-에러-수정
Aug 27, 2025

Hidden character warning

The head ref may contain hidden characters: "refactor/\ubb3c\uc8fc\uae30-\ud587\ube5b\uc8fc\uae30-\uc5d0\ub7ec-\uc218\uc815"
Merged

refactor/물주기 햇빛주기 에러 수정#142
c5ln merged 2 commits into
developfrom
refactor/물주기-햇빛주기-에러-수정

Conversation

@c5ln
Copy link
Copy Markdown
Member

@c5ln c5ln commented Aug 27, 2025

refactor/물주기 햇빛주기 에러 수정

Summary by CodeRabbit

  • bug fixes
    • 물주기/햇빛주기 쿨다운 및 중복 요청 시 응답을 HTTP 202(ACCEPTED)와 통일된 에러 코드로 반환하도록 수정하고 안내 메시지를 간결화했습니다. 이미 수행된 경우에도 일관된 응답으로 혼선을 줄입니다.

@c5ln c5ln self-assigned this Aug 27, 2025
@c5ln c5ln linked an issue Aug 27, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

GardenService.sunlightGarden의 쿨다운 위반 시 예외를 IllegalStateException에서 CustomApiException(ErrorCode.SUNLIGHT_COOL_DOWN)으로 변경했습니다. ErrorCode의 WATERING_COOL_DOWN, ALREADY_WATERED_GARDEN, SUNLIGHT_COOL_DOWN가 400→202, 코드 E4000x→E20002로 통일되고 일부 메시지가 단축되었습니다.

Changes

Cohort / File(s) Summary
Sunlight cooldown handling
src/main/java/com/example/cp_main_be/domain/garden/garden/service/GardenService.java
햇빛 주기 쿨다운 위반 시 IllegalStateException 대신 CustomApiException(ErrorCode.SUNLIGHT_COOL_DOWN)을 던지도록 변경. 메시지 문구 미세 조정. 나머지 흐름(카운트 증가, 포인트 적립, 시간 기록)은 동일.
ErrorCode realignment
src/main/java/com/example/cp_main_be/global/common/ErrorCode.java
WATERING_COOL_DOWN, ALREADY_WATERED_GARDEN, SUNLIGHT_COOL_DOWN의 HTTP 상태를 BAD_REQUEST→ACCEPTED, 코드 E4000x→E20002로 통일. WATERING_COOL_DOWN 메시지 단축.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant S as GardenService
  participant E as ErrorCode (Enum)
  participant X as CustomApiException

  Note over C,S: 햇빛 주기 요청
  C->>S: sunlightGarden(gardenId, userId)
  S->>S: 최근 햇빛 시간/쿨다운 확인
  alt 쿨다운 위반(변경됨)
    S->>E: 사용 ErrorCode.SUNLIGHT_COOL_DOWN
    S-->>C: throw X(ErrorCode.SUNLIGHT_COOL_DOWN)
  else 가능
    S->>S: 햇빛 카운트 증가
    S->>S: 위시트리 포인트 적립
    S->>S: 햇빛 시간 기록
    S-->>C: 성공 응답
  end

  Note over E: WATERING_COOL_DOWN/ALREADY_WATERED_GARDEN/SUNLIGHT_COOL_DOWN = 202, E20002
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Poem

새벽 햇살 한 줌, 쿨다운은 지켜요 ☀️
물방울은 기다려, 응답은 이백이둘
당황 말고 토닥—에러코드로 말해요
정원은 안녕, 토끼는 점프!
오늘도 기록하고, 내일 또 빛 주어요 🌱

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent 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 e6610af and 445fed6.

📒 Files selected for processing (2)
  • src/main/java/com/example/cp_main_be/domain/garden/garden/service/GardenService.java (1 hunks)
  • src/main/java/com/example/cp_main_be/global/common/ErrorCode.java (1 hunks)
✨ 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/물주기-햇빛주기-에러-수정

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

@c5ln c5ln merged commit f23acb0 into develop Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor/ 물주기 햇빛주기 에러 수정

1 participant