Giter VIP home page Giter VIP logo

bookstore's People

Contributors

nohkwangsun avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

bookstore's Issues

구매 처리, 멤버와 연동하기

구매 처리, 멤버와 연동하기
. 구매처리 수정. (불필요)
. 구매이력조회 수정. (조회 기능 추가)

======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |    11. Modify a member           |                    =
=            |                                  |                    =
=            |    12. Print a user's purchases  |                    =
=            |                                  |                    =
=            |     s. Save                      |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:6
Purchase{title='홍길동', customer='김종국', numberOfPurchase=16}
Purchase{title='홍길동', customer='유재석', numberOfPurchase=11}
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |    11. Modify a member           |                    =
=            |                                  |                    =
=            |    12. Print a user's purchases  |                    =
=            |                                  |                    =
=            |     s. Save                      |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:12
Type user name:유재석
Purchase{title='홍길동', customer='유재석', numberOfPurchase=11}
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |    11. Modify a member           |                    =
=            |                                  |                    =
=            |    12. Print a user's purchases  |                    =
=            |                                  |                    =
=            |     s. Save                      |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:q

메뉴 2단 구성

너무 많은 메뉴 화면에 노출.
사용자 관리, 도서 검색, 구매 내역 등 구분하여 노출 후
명령어로 들어가서 그 후에 또 검색 할 수 있도록 메뉴 구성 필요

멤버 탈퇴

멤버 탈퇴
(데이터는 보존)

======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:8
Member{userName='유재석', email='[email protected]', address='10 sbs road', active='true'}
Member{userName='김종국', email='[email protected]', address='11 sbs road', active='true'}
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:10
Type user name:김종국
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:8
Member{userName='유재석', email='[email protected]', address='10 sbs road', active='true'}
Press enter for the menu...

BookStoreFactory 를 annotation 처리

객체 생성시마다 BookStoreFactory에 의존관계 정의 필요함.
annotation을 통해 자동으로 의존관계 맺을 수있도록 수정 필요

파일에 데이터 저장

파일에 데이터 저장
. 재고
. 멤버
. 구매

======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |    11. Modify a member           |                    =
=            |                                  |                    =
=            |     s. Save                      |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:8
Member{userName='김종국', email='[email protected]', address='11 sbs road', active='true'}
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |    11. Modify a member           |                    =
=            |                                  |                    =
=            |     s. Save                      |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:9
Type user name:유재석
Type email:[email protected]
Type address:15 sbs road
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |    11. Modify a member           |                    =
=            |                                  |                    =
=            |     s. Save                      |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:8
Member{userName='김종국', email='[email protected]', address='11 sbs road', active='true'}
Member{userName='유재석', email='[email protected]', address='15 sbs road', active='true'}
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |    11. Modify a member           |                    =
=            |                                  |                    =
=            |     s. Save                      |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:q

Process finished with exit code 0






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |    10. Withdraw a member         |                    =
=            |                                  |                    =
=            |    11. Modify a member           |                    =
=            |                                  |                    =
=            |     s. Save                      |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:8
Member{userName='김종국', email='[email protected]', address='11 sbs road', active='true'}
Member{userName='유재석', email='[email protected]', address='15 sbs road', active='true'}
Press enter for the menu...

database 연계

안정적인 데이터 저장을 위해 DB 도입

메모리 데이터로는 Transaction 처리 불가
별도의 저장 기능 불필요

git branch 가이드

git branch 가이드

    $ git branch # git branch 목록 조회

    $ git branch feature-003-addstock  # git branch 생성
    $ git checkout feature-003-addstock  # git branch 이동

    $ git add .  # commit 대상 소스 선택
    $ git commit -m “update”  # 소스 commit

    $ git push --set-upstream origin feature-003-addstock  # 최초  push 시 set-upstream 옵션 필요

    $ git checkout main  # main branch로 이동

    $ git merge feature-003-addstock  # 로컬에서 git merge,  github PR 로 merge 한 경우 생략
    $ git pull  # github PR로 merge한 경우, 로컬에 반영

파일에서 데이터 조회

도서 정보 파일에서 조회
구매 이력 파일에서 조회

List<Book> bookList = Files.lines(Path.of("booklist.csv"))
    .map(line -> {
        List<String> book = Arrays.stream(line.split(",")).map(String::trim).toList();
        return new Book(book.get(0), book.get(1), book.get(2), Integer.parseInt(book.get(3)), book.get(4), book.get(5));
    }).collect(Collectors.toList());

CLI 웰컴 메시지

CLI 웰컴 메시지
종료 처리
알수 없는 명령 처리

======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     0. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:3
Error: Unknown command : 3
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     0. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:q

Process finished with exit code 0

회원 등급 관리

회원 등급 관리하여 등급에 맞게 할인 또는 추가 포인트 제공

script 갱신

pid 체크하여 안정적으로 실행/중단 가능하도록 수정

도서 추가

도서 추가

======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:3
Type title:자바의정석
Type writer:남궁성
Type publisher:도우출판
Type price:30000
Type releaseDate:2017년
Type location:3층
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:1
-----------------------------------------------------------
| TITLE      	 | WRITER     	 | PRICE      	 | LOCATION   	 |
-----------------------------------------------------------
| 홍길동        	 | 작자미상       	 | 10000      	 | 2층 10번     	 |
-----------------------------------------------------------
| 홍길동1       	 | 작자미상       	 | 10000      	 | 2층 10번     	 |
-----------------------------------------------------------
| 홍길동2       	 | 작자미상       	 | 10000      	 | 2층 10번     	 |
-----------------------------------------------------------
| 자바의정석      	 | 남궁성        	 | 30000      	 | 3층         	 |
-----------------------------------------------------------
Press enter for the menu...

재고 추가

재고 추가

======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:1
-----------------------------------------------------------
-----------------------------------------------------------
| TITLE      	 | WRITER     	 | PRICE      	 | LOCATION   	 | STOCK      	 |
-----------------------------------------------------------
| 홍길동        	 | 작자미상       	 | 10000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동1       	 | 작자미상       	 | 10000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동2       	 | 작자미상       	 | 11000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동3       	 | 작자미상       	 | 13000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동4       	 | 작자미상       	 | 15000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:7
Type title:홍길동
Type stock:3
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:1
-----------------------------------------------------------
-----------------------------------------------------------
| TITLE      	 | WRITER     	 | PRICE      	 | LOCATION   	 | STOCK      	 |
-----------------------------------------------------------
| 홍길동        	 | 작자미상       	 | 10000      	 | 2층 10번     	 | 4          	 |
-----------------------------------------------------------
| 홍길동1       	 | 작자미상       	 | 10000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동2       	 | 작자미상       	 | 11000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동3       	 | 작자미상       	 | 13000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동4       	 | 작자미상       	 | 15000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
Press enter for the menu...

타이틀 검색

타이틀 검색

======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     0. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:2
Search Keyword:길동2
-----------------------------------------------------------
-----------------------------------------------------------
| TITLE      	 | WRITER     	 | PRICE      	 | LOCATION   	 |
-----------------------------------------------------------
| 홍길동2       	 | 작자미상       	 | 10000      	 | 2층 10번     	 |
-----------------------------------------------------------
Press enter for the menu...

버그. 정보 조회시 null 로 오류 발생

데이터 읽기 초기화 작업을 main으로 옮기면서 문제 발생.
bookservice 객체를 생성해서 파일 데이터 초기화하는 곳은 main 이었으나,
실제 사용하는 bookservice는 다른 곳 (clicommand) 에서 객체 생성해서 사용하고 있었음.

bookservice 인스턴스를 싱글톤 (단일 객체) 으로 만들어서 어디서 불러오든 동일하게 처리.

리팩토링. 명령어 분리

리팩토링. 명령어 분리

  1. 많은 명령어 한 클래스에 존재. 분리 필요
  2. 명령어는 각자 비즈니스 로직과 함께 메타를 보유
  3. 유효한 명령어는 명령어 번호와 타이틀, 설명 등을 포함

도서 구매

도서 구매
재고 갱신
구매 이력 조회

======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:1
-----------------------------------------------------------
-----------------------------------------------------------
| TITLE      	 | WRITER     	 | PRICE      	 | LOCATION   	 | STOCK      	 |
-----------------------------------------------------------
| 홍길동        	 | 작자미상       	 | 10000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동1       	 | 작자미상       	 | 10000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동2       	 | 작자미상       	 | 11000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동3       	 | 작자미상       	 | 13000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동4       	 | 작자미상       	 | 15000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:5
Type title:홍길동
Type customer:정국
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:1
-----------------------------------------------------------
-----------------------------------------------------------
| TITLE      	 | WRITER     	 | PRICE      	 | LOCATION   	 | STOCK      	 |
-----------------------------------------------------------
| 홍길동        	 | 작자미상       	 | 10000      	 | 2층 10번     	 | 0          	 |
-----------------------------------------------------------
| 홍길동1       	 | 작자미상       	 | 10000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동2       	 | 작자미상       	 | 11000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동3       	 | 작자미상       	 | 13000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
| 홍길동4       	 | 작자미상       	 | 15000      	 | 2층 10번     	 | 1          	 |
-----------------------------------------------------------
Press enter for the menu...





======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:6
Purchase{title='홍길동', customer='정국', numberOfPurchase=1}
Press enter for the menu...

회원 등록

회원 등록

/Users/pieuler/Library/Java/JavaVirtualMachines/temurin-18.0.1/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=65298:/Applications/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/pieuler/workspaces/hw-project/nohkwangsun/bookstore/bookstore/out/production/bookstore com.onlinejava.project.bookstore.Main





======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:8
Member{userName='유재석', email='[email protected]', address='10 sbs road'}
Member{userName='김종국', email='[email protected]', address='11 sbs road'}
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:9
Type user name:조세호
Type email:[email protected]
Type address:13 running road
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     9. Add new member            |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:8
Member{userName='유재석', email='[email protected]', address='10 sbs road'}
Member{userName='김종국', email='[email protected]', address='11 sbs road'}
Member{userName='조세호', email='[email protected]', address='13 running road'}
Press enter for the menu...

책 목록 조회

책 목록 조회

======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     0. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:1
-----------------------------------------------------------
| TITLE      	 | WRITER     	 | PRICE      	 | LOCATION   	 |
-----------------------------------------------------------
| 홍길동        	 | 작자미상       	 | 10000      	 | 2층 10번     	 |
-----------------------------------------------------------
| 홍길동1       	 | 작자미상       	 | 10000      	 | 2층 10번     	 |
-----------------------------------------------------------
| 홍길동2       	 | 작자미상       	 | 10000      	 | 2층 10번     	 |
-----------------------------------------------------------
Press enter for the menu...

고객용 클라이언트/서버 구성

프로젝트를 3개로 분리

  1. 기존 admin 기능에서 공통 요소를 별도 프로젝트로 생성 : core
  2. 기존 admin 에서는 core의 jar를 받아서 수정 : admin
  3. 신규 client 에서는 core의 jar를 받아서 개발 : client

서버-클라이언트 프로그램

  1. admin에 SocketServer 구현
  2. client에 Socket 연결 구현

배포

  1. client용 배포 docker 구성

도서 삭제

도서 삭제

======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:4
Type title:홍길동
Press enter for the menu...






======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:1
-----------------------------------------------------------
| TITLE      	 | WRITER     	 | PRICE      	 | LOCATION   	 |
-----------------------------------------------------------
| 홍길동1       	 | 작자미상       	 | 10000      	 | 2층 10번     	 |
-----------------------------------------------------------
| 홍길동2       	 | 작자미상       	 | 10000      	 | 2층 10번     	 |
-----------------------------------------------------------
Press enter for the menu...

회원 목록 조회

회원 목록 조회

/Users/pieuler/Library/Java/JavaVirtualMachines/temurin-18.0.1/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=63068:/Applications/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/pieuler/workspaces/hw-project/nohkwangsun/bookstore/bookstore/out/production/bookstore com.onlinejava.project.bookstore.Main





======================================================================
=                                                                    =
=                                                                    =
=                   Welcome to Bookstore                             =
=                                                                    =
=            ------------------------------------                    =
=            |                                  |                    =
=            |     1. Print book list           |                    =
=            |                                  |                    =
=            |     2. Book Search               |                    =
=            |                                  |                    =
=            |     3. Add new book              |                    =
=            |                                  |                    =
=            |     4. Delete a book             |                    =
=            |                                  |                    =
=            |     5. buy a book                |                    =
=            |                                  |                    =
=            |     6. Print purchase list       |                    =
=            |                                  |                    =
=            |     7. Add book stock            |                    =
=            |                                  |                    =
=            |     8. Print member list         |                    =
=            |                                  |                    =
=            |     q. Quit                      |                    =
=            |                                  |                    =
=            ------------------------------------                    =
=                                                                    =
======================================================================
Type the number of the command you want to run:8
Member{userName='유재석', email='[email protected]', address='10 sbs road'}
Member{userName='김종국', email='[email protected]', address='11 sbs road'}
Press enter for the menu...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.