Skip to content

feat : 리얼퀴즈 개선, Pannel 정보 API 구현#112

Merged
c5ln merged 2 commits into
developfrom
refactor/새로운-퀴즈에-맞게-기존-코드-수정
Aug 26, 2025

Hidden character warning

The head ref may contain hidden characters: "refactor/\uc0c8\ub85c\uc6b4-\ud034\uc988\uc5d0-\ub9de\uac8c-\uae30\uc874-\ucf54\ub4dc-\uc218\uc815"
Merged

feat : 리얼퀴즈 개선, Pannel 정보 API 구현#112
c5ln merged 2 commits into
developfrom
refactor/새로운-퀴즈에-맞게-기존-코드-수정

Conversation

@c5ln
Copy link
Copy Markdown
Member

@c5ln c5ln commented Aug 26, 2025

📝 개요

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

  • 당일 만들어진 퀴즈만 불러오도록 수정
  • 홈 화면 패널 API 구현

💻 작업 내용

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

  • 당일 만들어진 UserQuiz 엔티티만 불러오도록 UserQuizRepository 수정
  • 홈 화면 패널을 위한 API 구현

✅ PR 체크리스트

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

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

🔗 관련 이슈

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


스크린샷 (선택)

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

Summary by CodeRabbit

  • 신기능

    • 홈 패널 조회 엔드포인트 추가로 일기/체크/퀴즈 완료 상태를 한눈에 확인할 수 있습니다.
  • 개선

    • 일일 미션 패널에 오늘 완료한 미션 수가 실시간 계산되어 표시됩니다.
    • 퀴즈가 사용자별 ‘하루 1회’ 기준으로 관리되며, 완료 여부가 사용자 단위로 기록됩니다.
  • 변경 사항

    • 퀴즈 유형이 OX와 객관식으로 단순화되었습니다.
    • 일부 일일 미션의 퀴즈 관련 조회/제출 API가 비활성화되었습니다.
    • 리얼 퀴즈 응답에서 완료 여부 표시가 제거되었습니다.

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

coderabbitai Bot commented Aug 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

새 홈 패널 API와 DTO를 추가하고, HomeService에 당일 일기/퀴즈 완료 여부 계산 로직을 도입했습니다. 퀴즈 도메인은 일일(UserQuiz 기반) 흐름으로 재구성되어 컨트롤러/서비스 시그니처가 사용자 인자를 받도록 변경되었습니다. 일부 퀴즈 관련 엔드포인트가 제거되었고, 미션 패널의 오늘 완료 개수 계산이 추가되었습니다.

Changes

Cohort / File(s) Change summary
홈 패널 엔드포인트 추가
src/main/java/com/example/cp_main_be/domain/home/HomeController.java, src/main/java/com/example/cp_main_be/domain/home/service/HomeService.java, src/main/java/com/example/cp_main_be/domain/home/PannelResponseDTO.java
GET /api/v1/home/panel 신설. HomeService에 getPannelData(User) 추가하여 당일 일기/퀴즈/체킹 완료 여부 플래그 계산 후 PannelResponseDTO 반환. 컨트롤러는 ApiResponse 래퍼로 직접 반환.
일일 퀴즈 흐름 전환 및 완료 플래그 이동
src/main/java/com/example/cp_main_be/domain/realquiz/service/RealQuizService.java, .../presentation/RealQuizController.java, .../repository/UserQuizRepository.java, .../UserQuiz.java, .../RealQuiz.java
UserQuiz에 isCompleted, createdAt 필드 추가. RealQuiz의 isCompleted 제거 및 응답에서 제외. 오늘 날짜 범위로 UserQuiz 조회하는 리포지토리 메서드 추가. 서비스는 오늘자 UserQuiz가 없으면 생성, 정답 제출 시 UserQuiz 완료 처리. 컨트롤러/서비스 시그니처에 @AuthenticationPrincipal User 추가.
퀴즈 타입 축소
src/main/java/com/example/cp_main_be/domain/mission/quiz/enums/QuizType.java
CHOICE_WITH_PICTURE enum 상수 제거. 현재 OX, MULTI_CHOICE만 유지.
일일 미션 패널 계산 보강
src/main/java/com/example/cp_main_be/domain/mission/user_daily_mission/service/UserDailyMissionService.java
getMissionPanelData에서 오늘 완료 미션 수를 DTO 목록을 순회하며 합산하여 todayMissionCount에 설정.
퀴즈 관련 엔드포인트 비활성화
src/main/java/com/example/cp_main_be/domain/mission/user_daily_mission/presentation/UserDailyMissionController.java
일일 미션 컨트롤러의 퀴즈 조회/랜덤 조회/정답 제출 엔드포인트 제거(주석 처리). 관련 import 정리.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant HC as HomeController
  participant HS as HomeService
  participant DR as DiaryRepository
  participant UQR as UserQuizRepository

  U->>HC: GET /api/v1/home/panel
  HC->>HS: getPannelData(user)
  HS->>DR: findMyDiaries(user)
  HS->>UQR: findAllTodayUserQuizByUser(user, startOfDay, endOfDay)
  HS-->>HC: PannelResponseDTO{isDiary, isChecking=false, isQuiz}
  HC-->>U: ApiResponse.success(...)
Loading
sequenceDiagram
  autonumber
  actor U as User
  participant RC as RealQuizController
  participant RS as RealQuizService
  participant UQR as UserQuizRepository
  participant RQR as RealQuizRepository
  participant UQ as UserQuiz

  rect rgba(200,235,255,0.25)
  note over U,RS: 오늘의 퀴즈 조회 흐름
  U->>RC: GET /api/v1/real-quiz
  RC->>RS: getRealQuiz(user)
  RS->>UQR: findAllTodayUserQuizByUser(user, startOfDay, endOfDay)
  alt 없음
    RS->>RQR: create/find RealQuiz
    RS->>UQR: save new UserQuiz{isCompleted=false}
  end
  RS-->>RC: RealQuizResponseDTO (no isCompleted)
  RC-->>U: ApiResponse
  end

  rect rgba(225,255,225,0.35)
  note over U,RS: 정답 제출 및 완료 처리
  U->>RC: POST /api/v1/real-quiz/{id}/answer
  RC->>RS: getRealQuizAnswer(quizId, requestDTO, user)
  RS->>UQR: find today's UserQuiz by user/quiz
  RS->>UQ: mark isCompleted=true
  RS-->>RC: RealQuizAnswerResponseDTO
  RC-->>U: ApiResponse
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • xoruddl
  • lejuho

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 3d1f98a and 355bb48.

📒 Files selected for processing (11)
  • src/main/java/com/example/cp_main_be/domain/home/HomeController.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/home/PannelResponseDTO.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/home/service/HomeService.java (3 hunks)
  • src/main/java/com/example/cp_main_be/domain/mission/quiz/enums/QuizType.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/mission/user_daily_mission/presentation/UserDailyMissionController.java (2 hunks)
  • src/main/java/com/example/cp_main_be/domain/mission/user_daily_mission/service/UserDailyMissionService.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/RealQuiz.java (0 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/UserQuiz.java (2 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/presentation/RealQuizController.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/repository/UserQuizRepository.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/service/RealQuizService.java (5 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.

@github-actions
Copy link
Copy Markdown
Contributor

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

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


📝 개요

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


💻 작업 내용

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

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

✅ PR 체크리스트

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

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

🔗 관련 이슈

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


스크린샷 (선택)

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

@c5ln c5ln added Feature 기능 추가 시 Refactor 기능 변경 없는 코드 구조 개선 - 리팩토링 labels Aug 26, 2025
@c5ln c5ln merged commit ef96081 into develop Aug 26, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature 기능 추가 시 Refactor 기능 변경 없는 코드 구조 개선 - 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] 새로운 퀴즈에 맞게 기존 코드 수정

1 participant