Skip to content

Conversation

@pleasebelieveme
Copy link
Owner

@pleasebelieveme pleasebelieveme commented Nov 4, 2025

  • 로또 번호 범위 상수 (MIN, MAX, COUNT)
  • 로또 가격 상수 (LOTTO_PRICE)
  • 중복 상수 제거 및 일관성 향상"

Summary by CodeRabbit

릴리스 노트

  • 리팩터링
    • 로또 게임의 공통 상수(최소/최대 번호, 로또 개수, 가격, 최소 구매 금액)를 중앙에서 관리하도록 통합했습니다. 상수 정의 위치를 일원화하여 코드 유지보수성을 개선했습니다.

@pleasebelieveme pleasebelieveme merged commit 151f660 into main Nov 4, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

새로운 LottoConstants 클래스를 만들어 로또 게임의 상수들(최소/최대 번호, 개수, 가격 등)을 중앙에서 관리하도록 정리했습니다. 기존에 여러 클래스에 분산된 상수들을 이 새로운 클래스로 통합하고, 관련 파일들의 import와 참조를 업데이트했습니다.

Changes

Cohort / File(s) Summary
상수 클래스 신설
src/main/java/lotto/common/LottoConstants.java
로또 게임 관련 상수 5개를 보유한 새로운 상수 홀더 클래스 추가 (MIN_LOTTO_NUMBER, MAX_LOTTO_NUMBER, LOTTO_NUMBER_COUNT, LOTTO_PRICE, MIN_PURCHASE_AMOUNT)
상수 사용처 업데이트
src/main/java/lotto/service/LottoGameService.java,
src/main/java/lotto/util/LottoGenerator.java,
src/main/java/lotto/validator/InputValidator.java
LottoConstants의 정적 import 추가 및 기존 상수 참조 제거; LottoGenerator에서 LOTTO_PRICE 상수 제거
테스트 코드 업데이트
src/test/java/lotto/util/LottoGeneratorTest.java
정적 import를 Lotto에서 LottoConstants로 변경; test1의 expectedCount 계산식 업데이트; 새로운 test3 메서드 추가 (100,000원 구매 시 다양한 로또 번호 생성 검증)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • 주의 사항:
    • LottoGeneratorTest.java의 새로운 test3 메서드: 100,000개의 로또 생성과 관련된 로직이 성능에 영향을 미칠 수 있는지 확인 필요
    • 상수 이동에 따른 모든 파일의 정적 import 일관성 검증

Possibly related PRs

Poem

🐰 상수들을 모아 한곳에,
흩어진 숫자들 정리하며,
로또의 규칙 명확하게,
코드는 깔끔해지고,
게임은 계속 굴러간다! 🎰✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pleasebelieveme

📜 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 8da9aee and 09082b2.

📒 Files selected for processing (5)
  • src/main/java/lotto/common/LottoConstants.java (1 hunks)
  • src/main/java/lotto/service/LottoGameService.java (3 hunks)
  • src/main/java/lotto/util/LottoGenerator.java (1 hunks)
  • src/main/java/lotto/validator/InputValidator.java (1 hunks)
  • src/test/java/lotto/util/LottoGeneratorTest.java (3 hunks)

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants