-
Notifications
You must be signed in to change notification settings - Fork 108
[그리디] 강대현 로또 미션 3, 4, 5 단계 제출합니다. #175
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
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
84a584f
feat: 로또 기본 클래스 구조 생성
Kdahyn 57a6996
feat: Lotto 클래스 생성 및 검증 코드 추가
Kdahyn 65c7547
feat: RandomNumberGenerator 구현
Kdahyn 0fcc57b
feat: LottoShop 및 일급 컬렉션 Lottos 구현
Kdahyn 21cbf68
feat: InputView와 OutputView 구현
Kdahyn c22fb34
feat: LottoController 와 Application 구현
Kdahyn 00d965e
fix: Lottos 방어적 복사 및 메소드 명칭 변겅
Kdahyn c785cf3
refactor: OutputView가 Lottos에 의존하지 않도록 수정
Kdahyn 2f26698
test: LottoTest 작성
Kdahyn de6d26e
test: LottosTest, LottoShopTest, TestNumberGenerator 작성
Kdahyn ddc142a
feat: 지난 주 당첨 번호 입력 기능 추가
Kdahyn d3f7ba7
feat: 로또 당첨 통계 집계 기능 추가
Kdahyn 4811aef
feat: 로또 당첨 통계 및 수익률 출력 기능 구현
Kdahyn e2d7f58
refactor: 구입 금액을 PurchaseAmount로 포장
Kdahyn fffdd21
refactor: 로또 번호를을 LottoNumber로 포장
Kdahyn 47405fe
test: 전반적인 테스트 수정 및 추가
Kdahyn 7017a06
docs: 리드미 작성
Kdahyn 135ce7b
refactor: generator 패키지 생성
Kdahyn 743f4ce
fix: 리드미 수정
Kdahyn 7bbb4df
refactor: 객체 생성 책임을 Application으로 이동
Kdahyn 2f4bb82
refactor: 리스트 방어적 복사 방식 통일
Kdahyn dc5f949
refactor: Rank 조회가 enum 필드를 활용하도록 개선
Kdahyn cc52c55
refactor: LOTTE_SIZE를 static으로 변경
Kdahyn 43547a3
test: LottoNumber 경계값 테스트를 파라미터 테스트로 통합
Kdahyn 166ff45
refactor: generator를 호출할때 LottoNumber를 재사용 하도록 수정
Kdahyn 4cc8f1e
refactor: 로또 번호 정렬 책임을 OutputView로 이동
Kdahyn f4cdd47
refactor: WinningStatistics로 당첨 통계 생성 책임 이동
Kdahyn a965222
refactor: WinningResult 생성 책임을 WinningStatistics로 이동
Kdahyn 1136f01
refactor: Lottos 값을 List로 전달
Kdahyn 6585e92
refactor: getter 위치 변경
Kdahyn 93c931b
fix: 입력 시 불필요 정렬 제거
Kdahyn a98be00
test: LottoShopTest 수정
Kdahyn ec60bb6
refactor: controller에서 DTO를 생성하도록 변경
Kdahyn 2257a30
feat: BonusBall 도입 및 2등 당첨 로직 구현
Kdahyn 50f8cbf
feat: 수동 로또 입력 기능 추가
Kdahyn 5eee051
feat: LottoShop 수동/자동 로또 통합 발급 기능 추가
Kdahyn 6371f02
feat: 수동 로또 구입 수 표시 추가
Kdahyn 0ce58f8
refactor: WinningResult 생성 책임을 Controller에서 WinningResult로 이동
Kdahyn 6270d12
refactor: WinningResult 구조 변경
Kdahyn 97c03ab
feat: manualCount를 ManualLottoCount로 원시값 포장
Kdahyn 2a9c1d1
test: LottoShopTest 수정
Kdahyn f7bf823
test: ManualLottoCountTest 추가
Kdahyn 76adb1b
docs: README 수정
Kdahyn 07e7ed1
upstream/kdahyn 브랜치 병합
Kdahyn 29b1bc5
refactor: 와일드카드 import 해제
Kdahyn da199f6
refactor: Lotto 생성 시 번호 정렬
Kdahyn 6e33782
refactor: Rank로 당첨 결과 메시지 책임 이동
Kdahyn 16c27c6
refactor: 검증 메서드를 static으로 변경
Kdahyn 16f706a
refactor: matchCount 필드 제거
Kdahyn 1ae5b41
refactor: WinningStatistics에 EnumMap 적용
Kdahyn c3bda2c
refactor: Lotto, Lottos의 변환 책임을 각 객체로 이동
Kdahyn f27e9cc
feat: 입력 검증 실패 시 재시도 로직 추가
Kdahyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package domain; | ||
|
|
||
| public record BonusBall(LottoNumber number) { | ||
| public BonusBall { | ||
| validate(number); | ||
| } | ||
|
|
||
| private void validate(LottoNumber number) { | ||
| if (number == null) { | ||
| throw new IllegalArgumentException("보너스 볼은 필수입니다."); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package domain; | ||
|
|
||
| public class ManualLottoCount { | ||
| private final int count; | ||
|
|
||
| public ManualLottoCount(int count, PurchaseAmount purchaseAmount) { | ||
| validate(count, purchaseAmount); | ||
| this.count = count; | ||
| } | ||
|
|
||
| private void validate(int count, PurchaseAmount purchaseAmount) { | ||
| if (count < 0) { | ||
| throw new IllegalArgumentException("수동 구매 수는 0 이상이어야 합니다."); | ||
| } | ||
| if (count > purchaseAmount.calculateLottoCount()) { | ||
| throw new IllegalArgumentException("수동 로또 수는 총 로또 수를 넘을 수 없습니다."); | ||
| } | ||
| } | ||
|
|
||
| public int count() { | ||
| return count; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
요 검증 메소드의 경우
this필드에 접근하지 않으므로static으로 선언해도 무방할 것 같은데 어떻게 생각하시나요?++
LottoNumber내 선언된 검증 메소드도 동일해요~~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.
앗, 그렇군요! 말씀해주신 대로
this필드에 접근하지 않는 검증 메서드들은static으로 변경했습니다.