Skip to content

Feat/퀴즈 재구현 진짜최종#106

Merged
c5ln merged 5 commits into
developfrom
feat/퀴즈-재구현
Aug 26, 2025

Hidden character warning

The head ref may contain hidden characters: "feat/\ud034\uc988-\uc7ac\uad6c\ud604"
Merged

Feat/퀴즈 재구현 진짜최종#106
c5ln merged 5 commits into
developfrom
feat/퀴즈-재구현

Conversation

@c5ln
Copy link
Copy Markdown
Member

@c5ln c5ln commented Aug 26, 2025

Feat/퀴즈 재구현 진짜최종

Summary by CodeRabbit

  • New Features

    • 퀴즈 조회 API와 옵션 포함 응답 DTO 추가
    • 퀴즈 답안 제출 처리 시 완료 여부(isCompleted) 반영
    • 퀴즈 생성 시 생성 시각(createdAt) 자동 기록
  • API Changes

    • 내 퀴즈 조회: 경로가 /list에서 기본 경로로 변경(GET)
    • 퀴즈 정답 제출: HTTP 메서드가 GET → POST로 변경
    • 정답 응답에서 quizId, quizOptions 제거, isCompleted 필드 추가
  • Security

    • realQuiz 관련 엔드포인트를 인증 없이 접근 가능하도록 허용

@c5ln c5ln self-assigned this Aug 26, 2025
@c5ln c5ln added the Refactor 기능 변경 없는 코드 구조 개선 - 리팩토링 label Aug 26, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

RealQuiz 엔티티에 완료 여부와 생성 시각 필드가 추가되었다. 응답 DTO 구조가 변경되고 새로운 RealQuizResponseDTO가 추가되었다. 컨트롤러의 매핑이 일부 변경되었고, 실질 로직을 담당하는 RealQuizService가 새로 도입되었다. 보안 설정에 RealQuiz 엔드포인트 공개 허용이 추가되었다.

Changes

Cohort / File(s) Summary of Changes
Domain Model Update
src/main/java/com/example/cp_main_be/domain/realquiz/RealQuiz.java
isCompleted(Boolean), createdAt(LocalDateTime, @CreationTimestamp) 필드 추가 및 관련 import 추가.
DTO Restructuring
.../domain/realquiz/dto/response/RealQuizAnswerResponseDTO.java, .../domain/realquiz/dto/response/RealQuizResponseDTO.java
AnswerResponseDTO에서 quizId, quizOptions 제거, isCompleted 추가. 새 RealQuizResponseDTO 및 내부 RealQuizOptionResponseDTO 도입.
Controller Mapping Updates
.../domain/realquiz/presentation/RealQuizController.java
GET /list → GET `` (루트)로 변경. /{quizId}/answer 매핑을 GET → POST로 변경. 시그니처는 동일하며 서비스 호출 유지.
Service Introduction
.../domain/realquiz/service/RealQuizService.java
서비스 신규 추가: createRealQuiz, createUserQuiz, getRealQuiz, getRealQuizAnswer 구현. 퀴즈 생성/할당/답변 처리 및 DTO 변환 로직 포함.
Security Exposure
src/main/java/com/example/cp_main_be/global/config/SecurityConfig.java
"/api/v1/realQuiz/**""/api/v1/realQuiz" 경로를 permitAll에 추가.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant C as RealQuizController
  participant S as RealQuizService
  participant RQ as RealQuizRepo
  participant UQ as UserQuizRepo

  rect rgb(240,248,255)
  note over U,C: GET /api/v1/realQuiz?quizType=...
  U->>C: getRealQuiz(quizType)
  C->>S: getRealQuiz(user, quizType)
  S->>UQ: findByUserAndIncomplete(user)
  alt 기존 할당 없음
    S->>RQ: findByType(quizType)
    S->>S: 랜덤 선택
    S->>UQ: save(UserQuiz 할당)
  else 기존 할당 있음
    S->>RQ: findById(assigned.quizId)
  end
  S-->>C: RealQuizResponseDTO
  C-->>U: 200 OK + DTO
  end

  rect rgb(245,255,240)
  note over U,C: POST /api/v1/realQuiz/{id}/answer
  U->>C: getRealQuizAnswer(quizId, request)
  C->>S: getRealQuizAnswer(quizId, request)
  S->>RQ: findById(quizId)
  S->>S: 정답 비교, isCompleted=true 설정
  S-->>C: RealQuizAnswerResponseDTO
  C-->>U: 200 OK + DTO
  end

  rect rgb(255,250,240)
  note over C,S: POST /api/v1/realQuiz/create
  C->>S: createRealQuiz(request)
  S->>RQ: save(RealQuiz isCompleted=false)
  S->>RQ: saveAll(Options)
  S-->>C: RealQuizResponseDTO
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested labels

Feature

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 c8f7951 and 7227e2d.

📒 Files selected for processing (3)
  • src/main/java/com/example/cp_main_be/domain/realquiz/RealQuiz.java (2 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/dto/response/RealQuizAnswerResponseDTO.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/presentation/RealQuizController.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 feat/퀴즈-재구현

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant