Skip to content

점수 로직 추가#139

Merged
lejuho merged 1 commit into
developfrom
djh
Aug 27, 2025
Merged

점수 로직 추가#139
lejuho merged 1 commit into
developfrom
djh

Conversation

@lejuho
Copy link
Copy Markdown
Collaborator

@lejuho lejuho commented Aug 27, 2025

#132

Summary by CodeRabbit

  • 신규 기능
    • 다양한 활동(물주기/햇빛주기, 일기 작성, 데일리 질문, 퀴즈 정답, 방명록 작성) 시 위시트리 포인트가 적립됩니다.
    • 위시트리가 성장하면 이벤트 기반으로 정원 슬롯이 자동 해제됩니다.
  • 변경 사항
    • 일부 보상 체계가 경험치에서 위시트리 포인트로 전환되었습니다.
    • 방명록 작성 시 작성자에게 포인트가 지급됩니다.
    • 퀴즈 응답에 정답 여부(isCorrect)가 추가되어 결과를 즉시 확인할 수 있습니다.
  • 문서
    • 댓글 작성 API 설명에 targetType(DIARY/AVATAR_POST) 안내가 추가되었습니다.

@lejuho lejuho merged commit 8849039 into develop Aug 27, 2025
0 of 2 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

여러 도메인 서비스에서 경험치 지급을 WishTree 포인트 지급으로 전환했다. WishTree 성장 시 정원 슬롯 해제는 GardenService 직접 호출 대신 WishTreeEvolvedEvent 발행과 이벤트 리스너 처리로 변경됐다. 여러 서비스가 WishTreeService를 의존 주입받아 포인트를 적립한다. RealQuiz 응답에 isCorrect 필드가 추가됐다.

Changes

Cohort / File(s) Summary
WishTree 이벤트 전환
src/main/java/com/example/cp_main_be/domain/mission/wishTree/WishTreeService.java, src/main/java/com/example/cp_main_be/global/event/WishTreeEvolvedEvent.java
GardenService 의존 제거, ApplicationEventPublisher로 WishTreeEvolvedEvent 발행. 새 이벤트 페이로드 클래스 추가. 생성자 시그니처 변경.
Garden 포인트·이벤트 연계
src/main/java/com/example/cp_main_be/domain/garden/garden/service/GardenService.java
보상 로직을 UserService XP → WishTreeService 포인트로 교체(물주기·햇빛). 포인트/제한 상수 int → Long. WishTreeEvolvedEvent 리스너 추가로 슬롯 해제 처리.
콘텐츠 액션 포인트 적립
src/main/java/com/example/cp_main_be/domain/member/daily_question/service/DailyQuestionAnswerService.java, src/main/java/com/example/cp_main_be/domain/mission/diary/service/DiaryService.java, src/main/java/com/example/cp_main_be/domain/realquiz/service/RealQuizService.java, src/main/java/com/example/cp_main_be/domain/social/guestbook/service/GuestbookService.java, src/main/java/com/example/cp_main_be/global/listener/NotificationEventListener.java
각 액션 완료 시 WishTreeService.addPointsToWishTree 호출 추가(일일질문 15L, 일기 40L, 퀴즈 정답 15L, 방명록 2L, 친구 물주기 알림 시 2L). 관련 서비스에 WishTreeService 의존성 주입. RealQuiz 응답에 isCorrect 포함. 일부 생성자 시그니처 변경.
문서/어노테이션 업데이트
src/main/java/com/example/cp_main_be/domain/social/comment/presentation/CommentController.java
@operation 설명에 targetType(DIARY/AVATAR_POST) 명시 및 포맷 변경.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant GardenService
  participant DailyQSvc as DailyQuestionAnswerService
  participant DiaryService
  participant RealQuizService
  participant GuestbookService
  participant NotiListener as NotificationEventListener
  participant WishTreeService

  rect rgb(245,248,255)
    note over User,WishTreeService: 액션 시 WishTree 포인트 적립
    User->>GardenService: waterOwn/Friend, sunlight
    GardenService->>WishTreeService: addPointsToWishTree(userId, 2L/3L)

    User->>DailyQSvc: 답변 저장
    DailyQSvc->>WishTreeService: addPointsToWishTree(userId, 15L)

    User->>DiaryService: 일기 생성
    DiaryService->>WishTreeService: addPointsToWishTree(userId, 40L)

    User->>RealQuizService: 정답 제출
    RealQuizService->>RealQuizService: isCorrect 계산
    alt 정답
      RealQuizService->>WishTreeService: addPointsToWishTree(userId, 15L)
    end

    User->>GuestbookService: 방명록 작성
    GuestbookService->>WishTreeService: addPointsToWishTree(writerId, 2L)

    NotiListener->>WishTreeService: (친구 물주기 처리 중) addPointsToWishTree(senderId, 2L)
  end
Loading
sequenceDiagram
  autonumber
  participant WishTreeService
  participant EventBus as ApplicationEventPublisher
  participant GardenService as GardenService(@EventListener)

  rect rgb(245,255,245)
    note over WishTreeService,GardenService: 성장 이벤트 기반 슬롯 해제
    WishTreeService->>WishTreeService: 상태 변화 감지 (TREE로 진화)
    WishTreeService->>EventBus: publish(WishTreeEvolvedEvent(userId))
    EventBus-->>GardenService: WishTreeEvolvedEvent
    GardenService->>GardenService: handleWishTreeEvolved(event)로 슬롯 해제
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • xoruddl
  • c5ln

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 6b1672f and 5d3a745.

📒 Files selected for processing (9)
  • src/main/java/com/example/cp_main_be/domain/garden/garden/service/GardenService.java (6 hunks)
  • src/main/java/com/example/cp_main_be/domain/member/daily_question/service/DailyQuestionAnswerService.java (3 hunks)
  • src/main/java/com/example/cp_main_be/domain/mission/diary/service/DiaryService.java (3 hunks)
  • src/main/java/com/example/cp_main_be/domain/mission/wishTree/WishTreeService.java (3 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/service/RealQuizService.java (3 hunks)
  • src/main/java/com/example/cp_main_be/domain/social/comment/presentation/CommentController.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/social/guestbook/service/GuestbookService.java (3 hunks)
  • src/main/java/com/example/cp_main_be/global/event/WishTreeEvolvedEvent.java (1 hunks)
  • src/main/java/com/example/cp_main_be/global/listener/NotificationEventListener.java (3 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 djh

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.

@github-actions
Copy link
Copy Markdown
Contributor

🚨 PR 본문이 비어있습니다!

아래 템플릿을 복사하여 PR 내용을 작성해주세요.


📝 개요

이번 PR의 핵심 내용을 한 줄로 요약해 주세요.


💻 작업 내용

이번 PR에서 작업한 내용을 상세히 설명해 주세요.

  • 작업 내용 1
  • 작업 내용 2
  • ...

✅ PR 체크리스트

PR을 보내기 전에 아래 체크리스트를 확인해 주세요.

  • 커밋 메시지는 포맷에 맞게 작성했나요?
  • 스스로 코드를 다시 한번 검토했나요?
  • 관련 이슈를 연결했나요?
  • 빌드 및 테스트가 로컬에서 성공했나요?

🔗 관련 이슈

이번 PR과 관련된 이슈 번호를 기재해 주세요.
예: Closes #123


스크린샷 (선택)

UI 변경 사항이 있다면 스크린샷을 첨부해 주세요.

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.

1 participant