Skip to content

Conversation

@Kimminu7
Copy link
Collaborator

@Kimminu7 Kimminu7 commented Jun 20, 2025


작업 내용

  • timeLimit 데이터 타입 변경 ( + Swagger 정보 최신화 )
  • Difficulty Enum (난이도) 로직 변경

변경 사항


트러블 슈팅


해결해야 할 문제


참고 사항

  • 추후에 카테고리 enum 수정시, 카테고리 데이터 추가 필요

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

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

Summary by CodeRabbit

  • 신규 기능

    • 문제의 난이도 등급이 BRONZEDIAMOND에서 LV1LV7로 변경되고, 각 등급의 점수 체계가 10점에서 640점까지로 세분화되었습니다.
  • 버그 수정

    • 시간 제한 필드가 소수(Double)에서 정수(Long, 밀리초 단위)로 변경되어 입력 및 표시가 더 명확해졌습니다.
    • 메모리 제한 및 시간 제한 필드의 단위가 각각 KB와 ms로 명확히 표시됩니다.

@coderabbitai
Copy link

coderabbitai bot commented Jun 20, 2025

"""

Walkthrough

문제 관련 DTO 및 엔티티에서 시간 제한(timeLimit) 필드의 타입이 Double에서 Long으로 변경되고, 메모리 및 시간 제한 필드의 단위가 명확히 표시되도록 스키마 설명이 수정되었습니다. 또한, 난이도(Difficulty) enum이 LV1~LV7 단계와 새로운 점수 체계로 리팩터링되었습니다.

Changes

파일/경로 요약 변경 내용 요약
.../dto/request/ProblemCreateRequest.java
.../dto/request/ProblemUpdateRequest.java
.../dto/response/ProblemDetailResponse.java
timeLimit 타입을 Double에서 Long으로 변경, 스키마 설명에 단위(ms, KB) 명시 및 예시 값 수정
.../domain/problem/model/entity/Problem.java 엔티티의 timeLimit 필드 타입을 Double에서 Long으로 변경, 생성자 및 관련 메서드 시그니처 일괄 반영
.../domain/problem/model/enums/Difficulty.java 난이도 enum을 BRONZEDIAMOND에서 LV1LV7로 변경, 점수 체계 10~640으로 조정

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)
Loading

Suggested labels

enhancement, documentation

Suggested reviewers

  • chat26666
  • thezz9
  • pokerbearkr
  • minjee2758
  • NCookies

Poem

🐰
시간은 이제 정수로,
메모리도 단위를 밝혔지요!
난이도는 일곱 단계,
점수도 두 배로 쑥쑥.
코드밭에 새 질서,
토끼는 깡총,
변화의 봄을 노래해요!

"""


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 082ffd7 and 74042e8.

📒 Files selected for processing (1)
  • src/main/java/org/ezcode/codetest/domain/problem/model/enums/Difficulty.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/org/ezcode/codetest/domain/problem/model/enums/Difficulty.java
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
✨ 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 e41c128 and 082ffd7.

📒 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 전반의 일관성이 확보되었습니다.

Comment on lines 12 to 18
LV1("1", 10),
LV2("2", 20),
LV3("3", 40),
LV4("4", 80),
LV5("5", 160),
LV6("6", 320),
LV7("7",640);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

🧩 Verification correct

난이도 체계의 대규모 변경이 감지되었습니다.

기존 BRONZEDIAMOND 체계에서 LV1LV7로의 완전한 변경과 점수 체계의 기하급수적 증가 패턴 적용은 좋은 개선입니다. 하지만 이는 기존 데이터와의 호환성 문제를 야기할 수 있는 breaking change입니다.

다음 사항들을 확인해주세요:

  1. 기존 데이터베이스의 difficulty 값들과의 호환성
  2. 데이터 마이그레이션 계획
  3. 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입니다.

다음 사항들을 확인해주세요:

  1. 기존 데이터베이스의 difficulty 값들과의 호환성
  2. 데이터 마이그레이션 계획
  3. 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.

@pokerbearkr pokerbearkr merged commit a84ed50 into dev Jun 20, 2025
2 checks passed
@pokerbearkr pokerbearkr deleted the refactor/problem branch June 20, 2025 08:23
@Kimminu7 Kimminu7 changed the title Refactor/problem refactor : 데이터 타입, 로직 변경 ( timeLimit, Difficulty ) Jun 20, 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.

4 participants