-
Notifications
You must be signed in to change notification settings - Fork 3
refactor : 총 제출 횟수, 성공한 제출 횟수 dto추가 #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Walkthrough
Changes
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
📒 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 어노테이션이 명확한 한국어 설명과 함께 제공되었습니다
- 필드 순서가 논리적입니다 (총 제출 횟수 → 성공한 횟수)
| .totalSubmissions(problem.getTotalSubmissions()) | ||
| .correctSubmissions(problem.getCorrectSubmissions()) |
There was a problem hiding this comment.
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 javaLength 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.
작업 내용
변경 사항
트러블 슈팅
해결해야 할 문제
참고 사항
코드 리뷰 전 확인 체크리스트
type :)Summary by CodeRabbit