-
Notifications
You must be signed in to change notification settings - Fork 169
[1기-김동섭] [3주차] 바우처 관리 Command-line Application #7
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
| } | ||
| } | ||
|
|
||
| private long parseLong(String value) { |
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.
parseLong 메소드가 VoucherProgram안에 들어가는게 나을 지, Console클래스 안에 들어가는 게 나을 지 모르겠습니다.
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.
고민해 봤는데 그냥 Utils라는 클래스를 만들어 static method로 구현해서 가져다 쓰는게 좋을 거 같아서 다음 과제부터 반영하려 합니다..
| return voucherRepository.findAll(); | ||
| } | ||
|
|
||
| public boolean checkValidity(String type, long value) { |
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.
인풋으로 들어온 type과 value가 올바른 형태인지 확인하는 코드인데, 이게 VoucherService 클래스 내에서 해야 하는 작업인지, 아니면 VoucherProgram에서 넘겨 주기 전에 확인을 하고 올바른 경우에만 넘겨 주는 게 맞는 지 궁금합니다.
| return Optional.of(new PercentDiscountVoucher(UUID.randomUUID(), value)); | ||
| } else { | ||
| throw new RuntimeException(MessageFormat.format("Invalid type of voucher: {0}", type)); | ||
| } |
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.
여러 타입의 Voucher 객체들을 생성해야 하는데 어떤 방식으로 구현해 맞는 지 확신이 없습니다. 앞으로 Voucher 타입이 추가 되면, if-else-if 문이 계속 추가가 될텐데, factory 클래스 같은걸 만들어야 할까요?
46aaf32 to
ef9d24d
Compare
* On branch : develop
# 유저 생성 : UserFactory
# 유저 저장 : UserRepository
# 유저 타입 : UserType
* Changes to be committed:
Modified : User.java, UserFactory.java, UserFileRepository.java, UserType.java
* On branch : develop
# CSV 파일 읽기 : CSVReader
# CSV 파일 쓰기 : CSVWriter
# 샘플 CSV 파일 : user_allList, user_blackList
* Changes to be committed:
Modified : CSVReader.java, CSVWriter.java, sample.csv
* On branch : develop
# 메모리 저장소 : UserMemoryRepository
# 파일 저장소 : UserFileRepository
* Changes to be committed:
Modified : UserMemoryRepository.java, UserFileRepository.java
(BASIC-007) 바우처 삭제 테스트 코드 추가
feat : Implementation of receiving customer data from the console
refactor: JdbcVoucherRepository sql문 분리
################ # <타입> : <제목> 의 형식으로 제목을 아래 공백줄에 작성 # 제목은 50자 이내 / 변경사항이 "무엇"인지 명확히 작성 / 끝에 마침표 금지 # 예) feat : 로그인 기능 추가 # 바로 아래 공백은 지우지 마세요 (제목과 본문의 분리를 위함) ################ # 본문(구체적인 내용)을 아랫줄에 작성 # 여러 줄의 메시지를 작성할 땐 "-"로 구분 (한 줄은 72자 이내) ################ # 꼬릿말(footer)을 아랫줄에 작성 (현재 커밋과 관련된 이슈 번호 추가 등) # 예) Close prgrms-be-devcourse#7 ################ # feat : 새로운 기능 추가 # fix : 버그 수정 # docs : 문서 수정 # test : 테스트 코드 추가 # refact : 코드 리팩토링 # style : 코드 의미에 영향을 주지 않는 변경사항 # chore : 빌드 부분 혹은 패키지 매니저 수정사항 ################
################ # <타입> : <제목> 의 형식으로 제목을 아래 공백줄에 작성 # 제목은 50자 이내 / 변경사항이 "무엇"인지 명확히 작성 / 끝에 마침표 금지 # 예) feat : 로그인 기능 추가 # 바로 아래 공백은 지우지 마세요 (제목과 본문의 분리를 위함) ################ # 본문(구체적인 내용)을 아랫줄에 작성 # 여러 줄의 메시지를 작성할 땐 "-"로 구분 (한 줄은 72자 이내) ################ # 꼬릿말(footer)을 아랫줄에 작성 (현재 커밋과 관련된 이슈 번호 추가 등) # 예) Close prgrms-be-devcourse#7 ################ # feat : 새로운 기능 추가 # fix : 버그 수정 # docs : 문서 수정 # test : 테스트 코드 추가 # refact : 코드 리팩토링 # style : 코드 의미에 영향을 주지 않는 변경사항 # chore : 빌드 부분 혹은 패키지 매니저 수정사항 ################
📌 과제 설명
👩💻 요구 사항과 구현 내용
createlistexit✅ PR 포인트 & 궁금한 점
io폴더 내의Console, Input, Outputrepository폴더 내의InMemeoryRepository를 추가하고VoucherRepository를 변형했습니다.service폴더 내의VoucherService를 변형했습니다.VoucherProgram,CommandLineApplication,VoucherType