Skip to content

Conversation

@dongsubkim
Copy link

📌 과제 설명

  • 과제 링크
  • 커맨드 라인으로 voucher들을 관리하는 기능 추가

👩‍💻 요구 사항과 구현 내용

  • create
    • voucher 생성을 위한 커맨드
    • FixedAmountVoucher와 PercentDiscountVoucher 중 선택해 생성
    • 각 voucher에 필요한 값들도 input으로 받음
  • list
    • 이때까지 생성한 모든 voucher들 출력
  • exit
    • 프로그램 종료

✅ PR 포인트 & 궁금한 점

  • PR을 한번 신청했다가 수정할 부분들이 보여 수정하고 다시 PR 합니다.
  • 제가 과제를 위해 생성한 파일들은 다음과 같습니다. (이외의 파일들은 수업 내용에서 나온 것들입니다.)
    • io 폴더 내의 Console, Input, Output
    • repository 폴더 내의 InMemeoryRepository를 추가하고 VoucherRepository를 변형했습니다.
    • service 폴더 내의 VoucherService 를 변형했습니다.
    • VoucherProgram, CommandLineApplication, VoucherType
  • 궁금한 부분들에 코멘트 남겨놓았습니다!

@dongsubkim dongsubkim self-assigned this Aug 17, 2021
}
}

private long parseLong(String value) {
Copy link
Author

Choose a reason for hiding this comment

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

parseLong 메소드가 VoucherProgram안에 들어가는게 나을 지, Console클래스 안에 들어가는 게 나을 지 모르겠습니다.

Copy link
Author

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) {
Copy link
Author

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));
}
Copy link
Author

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 클래스 같은걸 만들어야 할까요?

@dongsubkim dongsubkim force-pushed the 1p/#1_dongsubkim_working branch from 46aaf32 to ef9d24d Compare August 18, 2021 15:45
@dongsubkim dongsubkim closed this Aug 18, 2021
@dongsubkim dongsubkim deleted the 1p/#1_dongsubkim_working branch August 18, 2021 15:56
kimziou77 added a commit to kimziou77/springboot-basic that referenced this pull request Apr 11, 2022
* On branch : develop
# 유저 생성 : UserFactory
# 유저 저장 : UserRepository
# 유저 타입 : UserType

* Changes to be committed:
                Modified : User.java, UserFactory.java, UserFileRepository.java, UserType.java
kimziou77 added a commit to kimziou77/springboot-basic that referenced this pull request Apr 11, 2022
* On branch : develop
# CSV 파일 읽기 : CSVReader
# CSV 파일 쓰기 : CSVWriter
# 샘플 CSV 파일 : user_allList, user_blackList

* Changes to be committed:
                Modified : CSVReader.java, CSVWriter.java, sample.csv
kimziou77 added a commit to kimziou77/springboot-basic that referenced this pull request Apr 11, 2022
* On branch : develop
# 메모리  저장소 : UserMemoryRepository
# 파일      저장소 : UserFileRepository

* Changes to be committed:
                Modified : UserMemoryRepository.java, UserFileRepository.java
moosongsong added a commit that referenced this pull request Apr 24, 2022
(BASIC-007) 바우처 삭제 테스트 코드 추가
zxcv9203 added a commit that referenced this pull request Jun 18, 2022
feat : Implementation of receiving customer data from the console
hseong3243 added a commit that referenced this pull request Jul 5, 2023
young970 added a commit that referenced this pull request Jul 22, 2023
refactor: JdbcVoucherRepository sql문 분리
ASak1104 added a commit to ASak1104/voucher-management-system that referenced this pull request Oct 17, 2023
################
# <타입> : <제목> 의 형식으로 제목을 아래 공백줄에 작성
# 제목은 50자 이내 / 변경사항이 "무엇"인지 명확히 작성 / 끝에 마침표 금지
# 예) feat : 로그인 기능 추가

# 바로 아래 공백은 지우지 마세요 (제목과 본문의 분리를 위함)

################
# 본문(구체적인 내용)을 아랫줄에 작성
# 여러 줄의 메시지를 작성할 땐 "-"로 구분 (한 줄은 72자 이내)

################
# 꼬릿말(footer)을 아랫줄에 작성 (현재 커밋과 관련된 이슈 번호 추가 등)
# 예) Close prgrms-be-devcourse#7

################
# feat : 새로운 기능 추가
# fix : 버그 수정
# docs : 문서 수정
# test : 테스트 코드 추가
# refact : 코드 리팩토링
# style : 코드 의미에 영향을 주지 않는 변경사항
# chore : 빌드 부분 혹은 패키지 매니저 수정사항
################
ASak1104 added a commit to ASak1104/voucher-management-system that referenced this pull request Oct 17, 2023
################
# <타입> : <제목> 의 형식으로 제목을 아래 공백줄에 작성
# 제목은 50자 이내 / 변경사항이 "무엇"인지 명확히 작성 / 끝에 마침표 금지
# 예) feat : 로그인 기능 추가

# 바로 아래 공백은 지우지 마세요 (제목과 본문의 분리를 위함)

################
# 본문(구체적인 내용)을 아랫줄에 작성
# 여러 줄의 메시지를 작성할 땐 "-"로 구분 (한 줄은 72자 이내)

################
# 꼬릿말(footer)을 아랫줄에 작성 (현재 커밋과 관련된 이슈 번호 추가 등)
# 예) Close prgrms-be-devcourse#7

################
# feat : 새로운 기능 추가
# fix : 버그 수정
# docs : 문서 수정
# test : 테스트 코드 추가
# refact : 코드 리팩토링
# style : 코드 의미에 영향을 주지 않는 변경사항
# chore : 빌드 부분 혹은 패키지 매니저 수정사항
################
aegis1920 pushed a commit that referenced this pull request Oct 22, 2023
1차 PR 리뷰 반영 - 2
ksy90101 pushed a commit that referenced this pull request Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants