Skip to content

Conversation

@Kimminu7
Copy link
Collaborator

@Kimminu7 Kimminu7 commented Jul 3, 2025

작업 내용

  • 총 제출 횟수, 성공한 제출 횟수 dto추가

변경 사항


트러블 슈팅


해결해야 할 문제


참고 사항


코드 리뷰 전 확인 체크리스트

  • 불필요한 콘솔 로그, 주석 제거
  • 커밋 메시지 컨벤션 준수 (type : )
  • 기능 정상 동작 확인

Summary by CodeRabbit

  • 신규 기능
    • 문제 정보에 전체 제출 수와 정답 제출 수가 추가로 표시됩니다.

@Kimminu7 Kimminu7 self-assigned this Jul 3, 2025
@Kimminu7 Kimminu7 added the documentation Improvements or additions to documentation label Jul 3, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 3, 2025

Walkthrough

ProblemResponse 레코드에 totalSubmissionscorrectSubmissions 필드가 추가되었습니다. 이 필드들은 Swagger 스키마 어노테이션과 예시 값이 포함되어 있으며, 정적 팩토리 메서드 from에서 Problem 엔티티의 대응 메서드를 통해 값을 할당하도록 수정되었습니다.

Changes

파일/경로 변경 요약
.../application/problem/dto/response/ProblemResponse.java totalSubmissions, correctSubmissions 필드 및 Swagger 주석 추가, 정적 팩토리 메서드에서 해당 값 할당 로직 반영

Suggested labels

enhancement

Suggested reviewers

  • NCookies
  • minjee2758
  • pokerbearkr

Poem

토끼가 깡총, 코드를 살펴보네
제출 수와 정답 수도 이제 곁에
문제 응답이 더 똑똑해졌지
Swagger에 예시도 꼼꼼히
깡총깡총, 개선의 발자취! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9da18dd and 12c989e.

📒 Files selected for processing (1)
  • src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemResponse.java (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: minjee2758
PR: ezcode-my/backend#43
File: src/main/java/org/ezcode/codetest/domain/user/model/entity/User.java:77-89
Timestamp: 2025-06-10T02:13:33.890Z
Learning: 이 프로젝트에서는 입력 검증을 DTO 레벨에서 수행하고 있으며, User 엔티티의 팩토리 메서드에서는 별도의 입력 검증을 하지 않는다.
Learnt from: chat26666
PR: ezcode-my/backend#37
File: src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchRepositoryDsl.java:10-10
Timestamp: 2025-06-06T19:56:27.759Z
Learning: When user chat26666 mentions that code was implemented in a previous PR but explanation was missing, they may submit a follow-up PR just to add documentation/explanation without the actual implementation code.
Learnt from: thezz9
PR: ezcode-my/backend#30
File: src/main/java/org/ezcode/codetest/application/submission/service/SubmissionService.java:44-46
Timestamp: 2025-06-04T13:12:17.636Z
Learning: SubmissionService에서 "2 10" 입력값과 "12" 기대출력이 하드코딩되어 있는 것은 테스트 단계의 의도적인 구현이며, 추후 Problem 엔티티의 실제 테스트케이스로 대체 예정입니다.
Learnt from: thezz9
PR: ezcode-my/backend#73
File: src/main/resources/templates/submit-test.html:135-135
Timestamp: 2025-06-18T11:41:58.457Z
Learning: src/main/resources/templates/submit-test.html 파일은 테스트용 파일로, isCorrect 값의 하드코딩은 의도적이며 사용자가 UI 요소를 통해 정답/오답 상태를 선택할 수 있도록 개선 예정입니다.
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (1)
src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemResponse.java (1)

37-41: 필드 추가가 적절하게 구현되었습니다.

새로운 필드들이 올바르게 선언되었습니다:

  • Long 타입은 제출 횟수 카운트에 적합합니다
  • Swagger 어노테이션이 명확한 한국어 설명과 함께 제공되었습니다
  • 필드 순서가 논리적입니다 (총 제출 횟수 → 성공한 횟수)

Comment on lines +58 to +59
.totalSubmissions(problem.getTotalSubmissions())
.correctSubmissions(problem.getCorrectSubmissions())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

팩토리 메서드 구현이 적절하나 검증이 필요합니다.

필드 설정이 기존 패턴과 일관되게 구현되었습니다. 다음 사항들을 확인해 주세요:

  • Problem 엔티티에 getTotalSubmissions()getCorrectSubmissions() 메서드가 존재하는지 확인
  • 이 메서드들이 null을 반환할 가능성이 있는지 확인

다음 스크립트를 실행하여 Problem 엔티티의 메서드 존재 여부를 확인해 주세요:


🏁 Script executed:

#!/bin/bash
# Description: Problem 엔티티에서 getTotalSubmissions와 getCorrectSubmissions 메서드 존재 여부 확인

# Problem 엔티티 파일에서 해당 메서드들 검색
ast-grep --pattern 'getTotalSubmissions() {
  $$$
}'

ast-grep --pattern 'getCorrectSubmissions() {
  $$$
}'

# 또는 메서드 시그니처 검색
rg -A 3 "getTotalSubmissions|getCorrectSubmissions" --type java

Length of output: 743


다음 스크립트를 실행하여 Problem 엔티티 클래스의 존재 여부와 totalSubmissions/correctSubmissions 필드 타입 및 Lombok 어노테이션 유무를 확인해 주세요:


🏁 Script executed:

#!/bin/bash
# 1. Problem 엔티티 클래스 파일 경로 및 선언부 확인
rg -n "class Problem" --type java

# 2. 클래스 선언부 주변(어노테이션 포함) 상세 확인
rg -A5 "class Problem" --type java

# 3. totalSubmissions 및 correctSubmissions 필드 정의 확인
rg -n "totalSubmissions" --type java
rg -n "correctSubmissions" --type java

# 4. Lombok @Getter/@Data 등 어노테이션 확인
rg -n "@Getter\|@Data\|@Value" --type java | rg "Problem"

Length of output: 19132


Problem 엔티티에 Getter 미구현 및 null 처리 보완 필요

  • Problem 도메인 엔티티에 getTotalSubmissions() / getCorrectSubmissions() 메서드 정의가 없어 컴파일 에러 발생
  • Long 타입 필드(totalSubmissions, correctSubmissions)에 대한 null 반환 가능성 검토 및 기본값 처리 필요

해결 방안:

  • Problem 클래스에 해당 getter 메서드를 직접 추가하거나 Lombok @Getter 어노테이션 적용
  • DTO 팩토리 메서드 호출부(ProblemResponse.from)에서 null 대비 기본값 처리 (예: Objects.requireNonNullElse(...) 등)

대상 파일:

  • src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java
  • src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemResponse.java (58–59)
🤖 Prompt for AI Agents
In src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java,
add getter methods for totalSubmissions and correctSubmissions fields or apply
Lombok @Getter annotation to enable access. In
src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemResponse.java
at lines 58-59, update the calls to problem.getTotalSubmissions() and
problem.getCorrectSubmissions() to handle possible null values by using
Objects.requireNonNullElse or a similar approach to provide default values,
preventing potential NullPointerExceptions.

@minjee2758 minjee2758 merged commit b1c8c42 into dev Jul 3, 2025
2 checks passed
@minjee2758 minjee2758 deleted the refactor/problem branch July 3, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants