Conversation
- 기존 AccountService에서 가독성과 유지보수를 위해 분리
- 기존 템플릿을 사용하는 곳에서 커서를 외부에서 넣어주기에 Supplier로 변경
- 임시 테이블에 bulk insert 하고 JOIN으로 bulk update 하도록 하여 쿼리 횟수를 최소화
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
내부적 변화
User에 송금 설정을 결정하는SendingTypeenum을 추가했습니다.EAGER는 기존 즉시 송금이고LAZY는 수금자가 직접 수금해야 하는 설정입니다.transaction테이블을 추가했습니다. 기본적으로 송금 계좌, 수금 계좌, 금액, 상태를 가집니다. 상태는PENDING,FINISHED,CANCELLED가 존재하며 각각 송금 처리, 수금 완료, 취소됨을 나타냅니다.구현사항
User엔티티에sendingType으로 필드를 추가했고, 이 값에 따라 즉시 송금인지, 지연 송금인지 결정됩니다.TransactionProcessor.wireTransfer()에서 해당 필드 값에 따라 다른 전략이 선택되어 실행됩니다.TransactionProcessor.receive()로 구현되어 있습니다. PENDING 상태인 거래를 FINISHED로 업데이트 처리하고 이 업데이트가 정상 실행되었으면 계좌에 금액을 추가합니다.프로그래밍 요구사항
기타
Transaction 관련 클래스들과 Mail 관련 클래스, User에 송금 타입 설정 등을 주로 수정해서 코드 리뷰 하실 때, 그런 클래스만 중점적으로 보셔도 좋을 것 같습니다!
코드가 조금 지저분해진 것 같은데 그런 부분이 있다고 여기시면 지적해 주시면 감사하겠습니다! 늦게 제출하게 되어 죄송합니다.