Skip to content

[5기 박유진] SpringBoot Part2 Weekly Mission 제출합니다. #933

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

Open
wants to merge 20 commits into
base: eugene225
Choose a base branch
from

Conversation

eugene225
Copy link

@eugene225 eugene225 commented Oct 27, 2023

📌 과제 설명

2차과제

  • customer가 생성되면 customer별 지갑이 한개만 생성되어서 지갑에서는 보유한 바우처 목록을 List<UUID> 형태로 관리
  • wallet에서 List<UUID> vouchers 바우처 목록을 DB에는 UUID를 json 형식으로 변환하여 입력

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

  • 바우처 관리 애플리케이션에 단위테스트를 작성해보세요.
  • customers 테이블 정의 및 추가
  • CustomerRepository 추가 및 JdbcTemplate을 사용해서 구현
  • 바우처에 엔터티에 해당하는 vouchers 테이블 정의
  • 바우처 레포지토리를 만들어보세요. (JdbcTemplate을 사용해서 구현)
  • 기존의 파일에서 바우처를 관리한 것을 vouchers 테이블을 통해서 CRUD가 되게 해보세요.
  • 특정 고객에게 바우처를 할당할 수 있습니다.
  • 고객이 어떤 바우처를 보유하고 있는지 조회할 수 있어야 합니다.
  • 고객이 보유한 바우처를 제거할 수 있어야 합니다.
  • 특정 바우처를 보유한 고객을 조회할 수 있어야 합니다.

✅ 피드백 반영사항

  • AppController의 역할 : voucher, customer, wallet 처리를 각각 매핑하는 역할 → ProgramFunction 이넘으로 분리
  • Voucher의 종류를 분리 X → voucherPolicy로 정책만 재분리
  • 이넘 명령어 입력시 LowerCase 변환 → 사용자 입력 대소문자 처리
  • endVoucherService로 프로그램 종료 → 결합도 강함 → 도메인별 Enum 분리
  • exception 처리 시 CustomException + message 담기
  • 바우처 생성 return null 은 의도하지 않은 방향. VoucherTypeFunction에서 exception throw catch는 다른 레이어로
  • csvFilehandler → try-with-resource → 자원관리
  • fileRepository → insert → error → throw exception
  • apllication.yaml → filePath 선언해서 initCsvFileHandler 필요하지 않도록

✅ PR 포인트 & 궁금한 점

  • CustomerController에서 Customer 생성 시 지갑을 동시에 생성되도록 만들어서 customerService만 참조하지 않고, walletService까지 참조하는 코드가 되었는데 코드에 문제가 있는지 궁금합니다.
  • 코드 결합도가 높은 부분을 집중적으로 코드리뷰 받고 싶습니다.
  • Wallet에 Voucher 객체를 직접 담을 수 없어 id만 리스트로 참조하도록 했는데, 더 효율적인 방법이 있을지 멘토님 의견이 궁급합니다.

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.

1 participant