Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f76a61a
feat: 프로젝트 초기 설정
yuminhwan Apr 5, 2022
8e8c35b
docs: docs/README.md 업데이트
yuminhwan Apr 6, 2022
bbb343a
feat: 금액으로 할인하는 기능 구현
yuminhwan Apr 6, 2022
fb53b16
docs: docs/README.md 업데이트
yuminhwan Apr 6, 2022
6f85729
feat: 퍼센트로 할인하는 기능 구현
yuminhwan Apr 6, 2022
b000b44
feat: 메모리 저장 기능 구현
yuminhwan Apr 6, 2022
7827314
refactor: Percent, Amount 값 검증 변경
yuminhwan Apr 6, 2022
f4bede4
feat: 스테레오타입 선언
yuminhwan Apr 6, 2022
285e8cf
feat: VoucherService 구현
yuminhwan Apr 6, 2022
552437e
style: @DisplayName 어노테이션 추가
yuminhwan Apr 6, 2022
03810f4
feat: Enum 타입 메뉴 구현
yuminhwan Apr 6, 2022
4cb88bb
refactor: VoucherType에서 입력값 검증하도록 변경
yuminhwan Apr 6, 2022
670f5fd
feat: 커스텀 Exception 추가
yuminhwan Apr 6, 2022
0139c98
feat: View 구현
yuminhwan Apr 6, 2022
5b180e0
feat: Voucher toString() 구현
yuminhwan Apr 6, 2022
309f187
feat: 로직에 맞게 실행가능하도록 구현
yuminhwan Apr 6, 2022
9c48220
docs: docs/README.md 업데이트
yuminhwan Apr 6, 2022
3022919
style: 메시지 알맞게 출력하도록 변경
yuminhwan Apr 6, 2022
bb3eb4f
style: insert -> save 메서드 네임 변경
yuminhwan Apr 6, 2022
58793ef
feat: VoucherType 바우처 이름으로 찾는 기능 구현
yuminhwan Apr 7, 2022
cd84843
style: 네이밍 변경
yuminhwan Apr 7, 2022
3922f90
style: Voucher toString 스타일 변경
yuminhwan Apr 7, 2022
a8cd305
refactor: VoucherType 바우처 이름으로 찾는 기능 삭제
yuminhwan Apr 7, 2022
5efb78b
fix: toString 변경
yuminhwan Apr 7, 2022
6763573
feat: Voucher 파일로 저장하는 기능 구현
yuminhwan Apr 7, 2022
012eb00
refactor: 재입력 재귀문 -> while문으로 변경
yuminhwan Apr 9, 2022
821cb36
refactor: VoucherType name 필드 삭제
yuminhwan Apr 9, 2022
a6cf82c
refactor: 프로젝트 폴더 구조 변경
yuminhwan Apr 9, 2022
2ae26ff
refactor: 프로젝트 폴더 구조로 인한 파일 경로 변경
yuminhwan Apr 9, 2022
83eb986
feat: 고객 블랙 리스트 명단 조회 기능 구현
yuminhwan Apr 9, 2022
26aac9b
feat: UserRepository 인터페이스 생성
yuminhwan Apr 9, 2022
db8eb47
feat: UserService 구현
yuminhwan Apr 9, 2022
869ca42
feat: blacklist 커맨드 입력 시 블랙리스트 조회 기능 구현
yuminhwan Apr 9, 2022
12b2500
refactor: 파일 경로가 올바르지 않을 시 프로그램 종료하도록 변경
yuminhwan Apr 9, 2022
4a343f9
style: 메서드 네이밍 변경
yuminhwan Apr 9, 2022
083c323
style: 코드 스타일 및 메서드 순서 변경
yuminhwan Apr 9, 2022
387144a
feat: yaml properties 및 profile 구현
yuminhwan Apr 9, 2022
8b4001f
fix: UserRepository 주입방식 수정
yuminhwan Apr 9, 2022
b177ab8
refactor: 파일 경로 수정
yuminhwan Apr 9, 2022
80a5955
docs: docs/README.md 업데이트
yuminhwan Apr 9, 2022
7dd78a2
feat: logger 기록
yuminhwan Apr 10, 2022
f189fa2
feat: logback 설정 적용
yuminhwan Apr 10, 2022
3d2286a
fix: 파일 경로가 올바르지 않을 시 프로그램 종료하지 못하는 버그 수정
yuminhwan Apr 10, 2022
28e2ce6
refactor: 블랙 리스트 파일 resource로 주입하도록 변경
yuminhwan Apr 10, 2022
b3249c2
refactor: try with resources로 리팩토링
yuminhwan Apr 10, 2022
e64c01c
style: 코드 정리
yuminhwan Apr 10, 2022
aa53602
docs: docs/README.md 업데이트
yuminhwan Apr 10, 2022
18f2281
style: 메서드명 변경
yuminhwan Apr 10, 2022
19732fe
refactor: resource를 applicationContext가 가져오도록 변경
yuminhwan Apr 10, 2022
399d6aa
fix: voucher 파일 경로 수정
yuminhwan Apr 10, 2022
70d5d56
refactor: log 콘솔에 안 찍히도록 변경
yuminhwan Apr 11, 2022
ca2b231
refactor: 불필요한 log 삭제 및 파일에서 데이터를 못 가져올 시 로그 생성
yuminhwan Apr 11, 2022
8efe433
refactor: 불필요한 메서드 삭제
yuminhwan Apr 11, 2022
8937202
refactor: 블랙리스트를 인스턴스 생성 시 가져오도록 변경
yuminhwan Apr 11, 2022
75959a5
refactor: @Value로 파일 위치 주입으로 변경
yuminhwan Apr 11, 2022
3c0abd8
refactor: 로그 메시지 수정
yuminhwan Apr 11, 2022
96ca2a3
refactor: 테스트 수정 및 테스트 케이스 추가
yuminhwan Apr 11, 2022
5ed7953
refactor: Mockito 적용
yuminhwan Apr 12, 2022
4538552
refactor: 캐싱 방식 변경
yuminhwan Apr 12, 2022
c4d01c1
refactor: @Value 적용 및 파일 못찾을 시 예외 발생하도록 수정
yuminhwan Apr 12, 2022
4755bab
refactor: 테스트 케이스 추가
yuminhwan Apr 12, 2022
f3cec86
style: 어노테이션 추가
yuminhwan Apr 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/


### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

# Mac
.DS_Store
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
66 changes: 66 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## SpringBoot Part1 Weekly Mission

### 미션 내용

(기본) **바우처 관리 애플리케이션**

- [x] Maven / Gradle 로 프로젝트를 실제로 구성하고 이때 Spring Boot CLI를 개발PC에 설치해서 명령어들을 사용해보고 프로젝트를 만든다. 그리고 IDE (IntelliJ)에서 실행시켜
본다.

- [x] 바우처 관리 Command-line Application을 만들어본다.

참고: [https://dzone.com/articles/interactive-console-applications-in-java](https://dzone.com/articles/interactive-console-applications-in-java)
- [x] 스프링부트 애플리케이션으로 만든다. (Web기능이 없이만듭니다. 즉, 서버가 띄지 않고 커맨드라인 애플리케이션으로 동작해야한다.)
- [x] 프로그램이 시작하면 다음과 같이 지원가능한 명령어를 알려준다.

```bash
=== Voucher Program ===
Type **exit** to exit the program.
Type **create** to create a new voucher.
Type **list** to list all vouchers.
```

- [x] create / list 커맨드를 지원한다.
- create 커맨드를 통해 바우처를 생성할수 있다. (FixedAmountVoucher, PercentDiscountVoucher)
- list 커맨드를 통해 만들어진 바우처를 조회할 수 있다.
- 바우처 정보를 매모리에 관리한다. 어플리케이션이 종료가 되어 데이터가 모두 사라져도 괜찮습니다. (나중에 영속성을 가지도록 변경할거에요 걱정마세요!)

- [x] 적절한 로그를 기록하고 `logback` 설정을해서 에러는 파일로 기록된다.

- [x] 실행가능한 `jar` 파일을 생성한다.

(심화) 파일을 통한 데이터관리 기능과 고객 블랙 리스트 명단 관리기능

- [x] 메모리 관리가 아닌 파일로 관리가 되는 Repository를 한번 만들어보세요.
- 기존 메모리 레포지토리는 지우지 말고 개발 프로파일에서만 동작하게 해보세요.
- [x] 고객 블랙 리스트 명단을 작성한다.
- customer_blacklist.csv 파일을 만들고 스프링 애플리케이션에서 해당 파일을 읽을 수 있고 블랙 리스트조회 할 수있다 (추가할 필요는 없어요. 블랙리스트는 파일로만 관리된다고 가정합니다.)
- [x] YAML 프라퍼티를 만들고 어떤 설정을 만들수 있을지 고민해본다.

### 구현해야 할 기능 목록

- [x] 입력
- [x] 메뉴 커맨드
- [x] Enum으로 관리
- [x] create 커맨드
- [x] FixedAmountVoucher
- [x] 할인 금액
- [x] 0이하일 경우
- [x] PercentDiscountVoucher
- [x] 할인 퍼센트
- [x] 0일 경우 예외 발생
- [x] 입력이 잘못되면 예외 발생

- [x] 출력
- [x] 바우처 조회
- [x] 블랙 리스트 조회

- [x] 바우처
- [x] 메모리, 파일
- [x] 원하는 바우처로 생성
- [x] 바우처 정보 저장
- [x] 저장한 바우처들 반환

- [x] 블랙리스트
- [x] 파일
- [x] 저장한 블랙리스트 반환
Loading