-
Notifications
You must be signed in to change notification settings - Fork 3
refactor : 데이터 타입, 로직 변경 ( timeLimit, Difficulty ) #82
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문제 관련 DTO 및 엔티티에서 시간 제한( Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Controller
participant Service
participant Problem Entity
Client->>Controller: 문제 생성/수정 요청 (memoryLimit[KB], timeLimit[ms])
Controller->>Service: DTO 전달 (Long 타입 timeLimit)
Service->>Problem Entity: 엔티티 생성/수정 (Long 타입 timeLimit)
Problem Entity-->>Service: 엔티티 반환
Service-->>Controller: 결과 반환
Controller-->>Client: 응답 (단위 명시된 memoryLimit, timeLimit)
Suggested labels
Suggested reviewers
Poem
""" 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ 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 (5)
src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemCreateRequest.java(1 hunks)src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemUpdateRequest.java(1 hunks)src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemDetailResponse.java(1 hunks)src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java(4 hunks)src/main/java/org/ezcode/codetest/domain/problem/model/enums/Difficulty.java(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (8)
src/main/java/org/ezcode/codetest/domain/problem/model/entity/Problem.java (2)
75-75: 생성자, 팩토리 메서드, 업데이트 메서드의 일관된 타입 변경이 완료되었습니다.모든 메서드에서 timeLimit 파라미터가 Long 타입으로 일관되게 변경되어 컴파일 에러 없이 정상 동작할 것입니다.
Also applies to: 90-90, 107-107
61-61: timeLimit 필드 타입 변경이 올바르게 적용되었습니다.Double에서 Long으로의 타입 변경이 일관되게 적용되었습니다. 하지만 단위가 초(초 단위의 소수점)에서 밀리초(정수)로 변경될 가능성이 있으므로 기존 데이터의 호환성을 확인해야 합니다.
기존 데이터베이스의 timeLimit 값들이 올바르게 변환되는지 확인해주세요:
#!/bin/bash # 기존 Problem 엔티티의 timeLimit 사용처와 데이터 검증 ast-grep --pattern 'timeLimit'src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemUpdateRequest.java (2)
25-25: 메모리 제한 필드에 단위 명시가 추가되어 API 명확성이 향상되었습니다."메모리 제한(KB)" 설명으로 단위가 명확해져 API 사용자가 올바른 값을 전달할 수 있습니다.
28-29: 시간 제한 필드의 타입 변경과 단위 명시가 올바르게 적용되었습니다.Double에서 Long으로의 타입 변경과 "(ms)" 단위 추가, 예시 값 "1000"으로의 변경이 일관되게 처리되었습니다. API 문서의 명확성이 크게 향상되었습니다.
src/main/java/org/ezcode/codetest/application/problem/dto/response/ProblemDetailResponse.java (2)
36-36: 메모리 제한 필드 설명 개선이 완료되었습니다."메모리 제한(KB)" 설명으로 API 응답 문서의 명확성이 향상되었습니다.
39-40: 시간 제한 필드의 타입과 설명 개선이 일관되게 적용되었습니다.Long 타입 변경과 "(ms)" 단위 명시, 예시 값 "1000"으로의 업데이트가 다른 DTO들과 일관되게 처리되었습니다.
src/main/java/org/ezcode/codetest/application/problem/dto/request/ProblemCreateRequest.java (2)
32-32: 메모리 제한 필드 설명에 단위가 명확히 추가되었습니다."메모리 제한(KB)" 설명으로 API 요청 시 필요한 값의 단위가 명확해졌습니다.
36-37: 시간 제한 필드의 타입 변경이 올바르게 완료되었습니다.Double에서 Long으로의 타입 변경과 "(ms)" 단위 명시가 다른 DTO들과 일관되게 적용되어 API 전반의 일관성이 확보되었습니다.
| LV1("1", 10), | ||
| LV2("2", 20), | ||
| LV3("3", 40), | ||
| LV4("4", 80), | ||
| LV5("5", 160), | ||
| LV6("6", 320), | ||
| LV7("7",640); |
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 correct
난이도 체계의 대규모 변경이 감지되었습니다.
기존 BRONZEDIAMOND 체계에서 LV1LV7로의 완전한 변경과 점수 체계의 기하급수적 증가 패턴 적용은 좋은 개선입니다. 하지만 이는 기존 데이터와의 호환성 문제를 야기할 수 있는 breaking change입니다.
다음 사항들을 확인해주세요:
- 기존 데이터베이스의 difficulty 값들과의 호환성
- 데이터 마이그레이션 계획
- API 버전 관리 전략
🏁 Script executed:
#!/bin/bash
# 기존 difficulty 값 사용처 확인
rg -A 3 "BRONZE|SILVER|GOLD|PLATINUM|DIAMOND"
# Problem 테이블의 difficulty 컬럼 데이터 타입 확인
ast-grep --pattern 'difficulty'Length of output: 9473
난이도 체계의 대규모 변경이 감지되었습니다.
기존 BRONZEDIAMOND 체계에서 LV1LV7로의 완전한 변경과 점수 체계의 기하급수적 증가 패턴 적용은 좋은 개선입니다. 하지만 이는 기존 데이터와의 호환성 문제를 야기할 수 있는 breaking change입니다.
다음 사항들을 확인해주세요:
- 기존 데이터베이스의 difficulty 값들과의 호환성
- 데이터 마이그레이션 계획
- API 버전 관리 전략
#!/bin/bash
# 기존 difficulty 값 사용처 확인
rg -A 3 "BRONZE|SILVER|GOLD|PLATINUM|DIAMOND"
# Problem 테이블의 difficulty 컬럼 데이터 타입 확인
ast-grep --pattern 'difficulty'🤖 Prompt for AI Agents
In src/main/java/org/ezcode/codetest/domain/problem/model/enums/Difficulty.java
around lines 12 to 18, the enum values have been changed from BRONZE~DIAMOND to
LV1~LV7 with a new exponential scoring system, which is a breaking change. To
fix this, verify compatibility with existing database difficulty values, plan
and implement necessary data migration scripts to convert old values to the new
scheme, and establish an API versioning strategy to support both old and new
difficulty formats during transition. Also, run the suggested shell commands to
audit current usage and data types before proceeding.
작업 내용
변경 사항
트러블 슈팅
해결해야 할 문제
참고 사항
코드 리뷰 전 확인 체크리스트
type :)Summary by CodeRabbit
신규 기능
DIAMOND에서 LV1LV7로 변경되고, 각 등급의 점수 체계가 10점에서 640점까지로 세분화되었습니다.버그 수정