Skip to content

Feat/퀴즈 재구현#104

Merged
c5ln merged 2 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/퀴즈 재구현#104
c5ln merged 2 commits into
developfrom
feat/퀴즈-재구현

Conversation

@c5ln
Copy link
Copy Markdown
Member

@c5ln c5ln commented Aug 26, 2025

Feat/퀴즈 재구현

Summary by CodeRabbit

  • 신기능
    • 실제 퀴즈 기능 추가: 퀴즈 조회, 보기 선택, 정답 및 해설 확인 지원
    • 사용자별 퀴즈 할당 및 현재 할당된 퀴즈 불러오기
    • 퀴즈 생성 및 보기 구성 요청/응답 포맷 제공
  • 보안
    • 퀴즈 관련 엔드포인트 접근 허용 범위 확대(/api/v1/realQuiz/*), 로그인 없이 이용 가능

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

coderabbitai Bot commented Aug 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

실제 퀴즈(RealQuiz) 기능이 신규 추가되었다. JPA 엔티티(RealQuiz, RealQuizOption, UserQuiz), DTO 요청/응답 세트, JPA 리포지토리 3종, 서비스(RealQuizService), 컨트롤러(RealQuizController), 그리고 보안 설정에 공개 경로(/api/v1/realQuiz/*)가 추가되었다.

Changes

Cohort / File(s) Summary
Domain 엔티티 추가
src/main/java/com/example/cp_main_be/domain/realquiz/RealQuiz.java, .../realquiz/RealQuizOption.java, .../realquiz/UserQuiz.java
실퀴즈, 보기 옵션, 사용자-퀴즈 매핑 엔티티 신규 추가. 기본 키, 컬럼 매핑, 연관관계(@manytoone) 정의.
DTO - Request
.../realquiz/dto/request/RealQuizCreateRequestDTO.java, .../realquiz/dto/request/RealQuizAnswerRequestDTO.java, .../realquiz/dto/request/UserQuizCreateRequestDTO.java
퀴즈 생성, 정답 제출, 사용자-퀴즈 할당 생성 요청 DTO 추가. 내부 옵션 생성 DTO 포함.
DTO - Response
.../realquiz/dto/response/RealQuizResponseDTO.java, .../realquiz/dto/response/RealQuizAnswerResponseDTO.java, .../realquiz/dto/response/UserQuizCreateResponseDTO.java
퀴즈 조회, 정답 결과, 사용자-퀴즈 할당 응답 DTO 추가. 옵션 응답 DTO 포함.
Repository
.../realquiz/repository/RealQuizRepostitory.java, .../realquiz/repository/RealQuizOptionRepository.java, .../realquiz/repository/UserQuizRepository.java
실퀴즈, 옵션, 사용자-퀴즈용 JPA 리포지토리 추가. 타입별 조회, 퀴즈별 옵션 조회, 사용자 기반 조회 메서드 정의.
Service
.../realquiz/service/RealQuizService.java
퀴즈 생성, 사용자-퀴즈 할당, 퀴즈 조회(없으면 자동 할당), 정답 검증 로직 구현. 트랜잭션 및 예외 처리 포함.
Controller
.../realquiz/presentation/RealQuizController.java
/api/v1/realQuiz 하위 REST 엔드포인트 추가: 생성(POST /create), 할당(POST /assign), 조회(GET /list), 정답 확인(GET /{quizId}/answer).
Security
src/main/java/com/example/cp_main_be/global/config/SecurityConfig.java
/api/v1/realQuiz/* 경로를 permitAll로 추가.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant RC as RealQuizController
  participant RS as RealQuizService
  participant RQRepo as RealQuizRepostitory
  participant RQORepo as RealQuizOptionRepository

  rect rgba(230,245,255,0.6)
  note over C,RS: 퀴즈 생성
  C->>RC: POST /api/v1/realQuiz/create (RealQuizCreateRequestDTO)
  RC->>RS: createRealQuiz(request)
  RS->>RQRepo: save(RealQuiz)
  RS->>RQORepo: saveAll(RealQuizOption...)
  RS-->>RC: RealQuizResponseDTO
  RC-->>C: ApiResponse<RealQuizResponseDTO>
  end
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant RC as RealQuizController
  participant RS as RealQuizService
  participant UQRepo as UserQuizRepository
  participant RQRepo as RealQuizRepostitory
  participant RQORepo as RealQuizOptionRepository

  rect rgba(235,255,235,0.6)
  note over C,RS: 퀴즈 조회 및 자동 할당
  C->>RC: GET /api/v1/realQuiz/list?quizType=...
  RC->>RS: getRealQuiz(user, quizType)
  RS->>UQRepo: findByUser(user)
  alt 미할당
    RS->>RQRepo: findAllByQuizType(quizType)
    RS->>UQRepo: save(UserQuiz(user, firstQuiz))
    RS->>RQORepo: findAllByRealQuiz(firstQuiz)
    RS-->>RC: RealQuizResponseDTO
  else 기할당
    RS->>RQORepo: findAllByRealQuiz(assignedQuiz)
    RS-->>RC: RealQuizResponseDTO
  end
  RC-->>C: ApiResponse<RealQuizResponseDTO>
  end
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant RC as RealQuizController
  participant RS as RealQuizService
  participant RQRepo as RealQuizRepostitory
  participant RQORepo as RealQuizOptionRepository

  rect rgba(255,240,230,0.6)
  note over C,RS: 정답 확인
  C->>RC: GET /api/v1/realQuiz/{quizId}/answer + body(selectedOptionOrder)
  RC->>RS: getRealQuizAnswer(quizId, request)
  RS->>RQRepo: findById(quizId)
  RS->>RQORepo: findAllByRealQuiz(quiz)
  RS-->>RC: RealQuizAnswerResponseDTO(isCorrect, ...)
  RC-->>C: ApiResponse<RealQuizAnswerResponseDTO>
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

Feature

Suggested reviewers

  • lejuho
  • xoruddl

Poem

새 퀴즈가 움트는 데이터의 밭,
토끼는 귀를 쫑긋, 옵션을 샥샥!
배정도 척, 정답도 착—
당근 포인트 챙기고 깡충 깡충 락.
/realQuiz 길 따라 별빛처럼 띠링! 🥕✨

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 2125ca9 and ee1831b.

📒 Files selected for processing (15)
  • src/main/java/com/example/cp_main_be/domain/realquiz/RealQuiz.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/RealQuizOption.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/UserQuiz.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/dto/request/RealQuizAnswerRequestDTO.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/dto/request/RealQuizCreateRequestDTO.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/dto/request/UserQuizCreateRequestDTO.java (1 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/dto/response/RealQuizResponseDTO.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/dto/response/UserQuizCreateResponseDTO.java (1 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/RealQuizOptionRepository.java (1 hunks)
  • src/main/java/com/example/cp_main_be/domain/realquiz/repository/RealQuizRepostitory.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 (1 hunks)
  • src/main/java/com/example/cp_main_be/global/config/SecurityConfig.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.

@c5ln c5ln merged commit 556c1c6 into develop Aug 26, 2025
0 of 2 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request 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.

[Feat] 퀴즈 재구현

1 participant