Skip to content
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

은행 창구 관리 앱 [STEP 4] Kyle, Effie #96

Open
wants to merge 107 commits into
base: d_Kyle
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
a5c53a3
config: .gitignore -> .DS_Store 추가
Changhyun-Kyle Jan 22, 2024
753b58d
config: swift lint 관련 프로젝트 설정
hyeffie Jan 22, 2024
341cdb6
config: 프로젝트 권장 설정 업데이트
hyeffie Jan 22, 2024
cffeab8
feat: Node, LinkedList, Queue 구현
hyeffie Jan 22, 2024
1b5cd93
chore: 구현 수정
hyeffie Jan 23, 2024
0d05289
test: 테스트 추가
hyeffie Jan 23, 2024
fe2b62d
test: 새 테스트 메서드 구현
hyeffie Jan 23, 2024
4087b7c
refine: 내부 로직 개선 및 불필요한 인터페이스 제거
hyeffie Jan 23, 2024
22dd555
Merge branch 'effie/step1/linked-list' into step1/linked-list
hyeffie Jan 23, 2024
d12e9ec
chore: 역할과 책임에 따른 객체 분리 및 파일 분리
Changhyun-Kyle Jan 23, 2024
261bbf0
chore: target membership 변경
Changhyun-Kyle Jan 23, 2024
59b980a
refine: 접근제어자 변경
Changhyun-Kyle Jan 23, 2024
471d7fe
test: 유닛테스트 로직 수정
Changhyun-Kyle Jan 23, 2024
5b60ff4
test: LinkedList 테스트 생성
hyeffie Jan 23, 2024
556d9a0
test: unit 구현 변경에 대응한 테스트 작성
hyeffie Jan 23, 2024
f77142f
test: 테스트 메서드 리팩토링
hyeffie Jan 23, 2024
d13abbc
Merge branch 'effie/step1/test' into step1/linked-list
hyeffie Jan 23, 2024
b3b621e
chore: Mark 주석 추가 외
Changhyun-Kyle Jan 23, 2024
c504188
chore: Node 클래스 final 키워드 추가
Changhyun-Kyle Jan 23, 2024
3346496
chore: Node 클래스 final 키워드 추가
Changhyun-Kyle Jan 23, 2024
047edca
chore: 유닛테스트 파일 이름 변경 및 파일 순서 변경
Changhyun-Kyle Jan 23, 2024
4e9fb54
config: 프로젝트 signing - team None으로 설정
hyeffie Jan 24, 2024
4b46f84
Merge branch 'step1/linked-list' into develop
hyeffie Jan 24, 2024
aa6a8b2
refactor: LinkedList 및 Queue 속성 추가
Changhyun-Kyle Jan 24, 2024
cf0e77f
refactor: 구현 변경에 따른 테스트 코드 수정
hyeffie Jan 24, 2024
2715ca4
refactor: Queue 및 LinkedList 로직 수정refactor: Queue 및 LinkedList 로직 수정
Changhyun-Kyle Jan 24, 2024
18326a8
refine: LinkedList Clear 테스트 코드 추가 및 테스트 함수명 수정
Changhyun-Kyle Jan 24, 2024
a449873
remove: 하나의 테스트 메서드에 두 번 이상 assert 하는 코드 수정
hyeffie Jan 24, 2024
843927b
refactor: Queue, LinkedList 구조체 > final class로 변경
hyeffie Jan 24, 2024
c7b962f
Merge branch 'step1/linked-list' into develop
hyeffie Jan 24, 2024
3dd96e5
fix: LinkedList init 및 clear 구현 수정
hyeffie Jan 24, 2024
a837452
Merge remote-tracking branch 'tasty/d_Kyle' into develop
hyeffie Jan 25, 2024
f9916dc
fix: removeFirst head와 tail이 같은 상황 대응
hyeffie Jan 25, 2024
5a3cd8e
feat: 초기 설계 구현
hyeffie Jan 26, 2024
d2eb5b4
refine: 메서드 묶기, 디버깅용 속성 추가
hyeffie Jan 26, 2024
69a9f7e
refactor: 타입 정리
hyeffie Jan 26, 2024
14829e5
chore: BankManagerApp 파일 추가 및 파일 이름 변경
hyeffie Jan 26, 2024
dec4ff5
feat: App 레벨 구현
hyeffie Jan 28, 2024
b48e9a6
fix: Banker의 queue는 concurrent 할 수 없다.
hyeffie Jan 28, 2024
7155b3a
fix: race condition 해결
hyeffie Jan 28, 2024
ce492db
refactor: 입출력 로직 리팩토링
hyeffie Jan 29, 2024
2701ba9
refine: client manager 관련 이름 변경
hyeffie Jan 29, 2024
aa75a2f
refine: 입출력 관련 이름 변경
hyeffie Jan 29, 2024
57ebc88
chore: 프로젝트 그룹 정리
hyeffie Jan 29, 2024
5890dd6
config: swiftlint sorted_imports 비활성화
Changhyun-Kyle Jan 29, 2024
cda4e92
feat: LinkedList 및 Queue count 속성 추가
Changhyun-Kyle Jan 29, 2024
9b12852
feat: LinkedList 및 Queue count 속성 추가
Changhyun-Kyle Jan 29, 2024
c43aeca
feat: BankManager -> 업무 시간 측정을 위한 measure 메서드 추가
Changhyun-Kyle Jan 29, 2024
2887ac2
test: LinkedList count 단위 테스트 작성
hyeffie Jan 29, 2024
38e5231
feat: 업무 시간 집계 기능 추가
hyeffie Jan 29, 2024
198dbf9
remove: 불필요한 구현 제거
hyeffie Jan 29, 2024
888ddeb
refine: dispatchClient -> dequeueClient로 이름 변경
Changhyun-Kyle Jan 29, 2024
2d5a9a7
Merge branch 'effie/step2/consoleApp' into develop
hyeffie Jan 29, 2024
d4307d2
feat: BankTaskType 추가
Changhyun-Kyle Jan 30, 2024
b003175
chore: 리뷰 사항 반영 -> private extension
Changhyun-Kyle Jan 30, 2024
7bb17ac
Merge remote-tracking branch 'tasty/d_Kyle' into develop
hyeffie Jan 30, 2024
32010e0
Merge remote-tracking branch 'origin/effie/step2/consoleApp' into dev…
hyeffie Jan 30, 2024
a51424b
refine: Banker queue 속성 제거
hyeffie Jan 30, 2024
9ee0538
wip: task 추상화
hyeffie Jan 30, 2024
1e2aba7
feat: STEP3 기능 구현
hyeffie Jan 30, 2024
c465f75
refine: banker 생성 로직 개선중
hyeffie Jan 31, 2024
8f3375c
wip: 대충 설계 틀 잡기
hyeffie Jan 31, 2024
61fa319
feat: BankManager 구현
hyeffie Jan 31, 2024
c41d133
feat: Banker 구현
hyeffie Jan 31, 2024
7b44ed0
feat: TaskManager 구현
hyeffie Jan 31, 2024
9220a80
feat: 동일한 그룹에 넣어주기
hyeffie Jan 31, 2024
9fcc515
fix: 업무를 처리하지 않는데도 고객이 dequeue되는 문제 해결
hyeffie Feb 1, 2024
e6f3d35
refactor: BankManagerApp 로직 리팩토링
Changhyun-Kyle Feb 1, 2024
642c17b
Merge branch 'hyeffie/step3/second-design' into step3/second-design
hyeffie Feb 1, 2024
ff77a3a
refine: enqueue 로직 시간 복잡도 개선
hyeffie Feb 1, 2024
31889b5
feat: 번호 생성 메서드 구현
hyeffie Feb 1, 2024
fe1ca17
refactor: Taskable 타입 > BankTaskType 열거형으로 교체
hyeffie Feb 1, 2024
bc7052c
Merge remote-tracking branch 'effie/hyeffie/step3/second-design' into…
hyeffie Feb 1, 2024
0979879
feat: 메뉴 입력 기능 추가
Changhyun-Kyle Feb 1, 2024
69846e7
fix: 고객 순서 정렬 버그 수정
Changhyun-Kyle Feb 1, 2024
32ce164
chore: 프로젝트 그룹 정리
Changhyun-Kyle Feb 1, 2024
a368204
fix: dequeue와 enqueue가 동시에 일어나며 발생하는 race 해결
hyeffie Feb 1, 2024
04624a2
refactor: TaskManager -> startTaskManaging() 메서드 로직 리팩토링
Changhyun-Kyle Feb 1, 2024
fc3f585
chore: Loan, Deposit 객체 파일 분리
Changhyun-Kyle Feb 1, 2024
ae11cd3
Merge branch 'step3/second-design' into develop
hyeffie Feb 1, 2024
ffc33cb
refactor: runBank() 로직 -> makeBankers() & makeClients()로 분리
Changhyun-Kyle Feb 1, 2024
db07c2c
chore: 불필요 인덴트 수정
Changhyun-Kyle Feb 1, 2024
669e777
Merge branch 'step3/second-design' into develop
hyeffie Feb 1, 2024
65f6852
refine: BankTaskType > BankTask 이름 변경
hyeffie Feb 2, 2024
3500122
refine: BankManagerAppError 구현
hyeffie Feb 2, 2024
ae9ee65
refine: 고객 번호 부여 로직 개선
hyeffie Feb 2, 2024
c2b4d3e
Merge remote-tracking branch 'tasty/d_Kyle' into develop
hyeffie Feb 3, 2024
e6b4373
wip: 보험..
hyeffie Feb 7, 2024
cf43a08
chore: 폴더 정리
hyeffie Feb 7, 2024
1e57f68
chore: 파일 정리
hyeffie Feb 7, 2024
617ea40
feat: 모듈 적용 및 UI 초기 설정
hyeffie Feb 7, 2024
2ba176f
feat: UI 관련 코드 추가
hyeffie Feb 7, 2024
21f384e
feat: 기존 코드 연결
hyeffie Feb 7, 2024
ed50259
fix: 시작시 table view item 중복 문제 해결
hyeffie Feb 7, 2024
6276957
chore: reset 로직 수정
hyeffie Feb 7, 2024
6946338
fix: 플래그를 사용해서 시작버튼 중첩 실행 방지
hyeffie Feb 8, 2024
9f655ab
feat: Timer 구현
hyeffie Feb 8, 2024
ed69f8a
feat: 시작 버튼 제거 및 타이머 reset 기능 구현
hyeffie Feb 8, 2024
cdc4b32
feat: 은행 업무 시간 측정 타이머 기능 구현
hyeffie Feb 8, 2024
70e912e
refine: BankManager 구현 정리
hyeffie Feb 8, 2024
6fb2deb
chore: 프로젝트 그룹 정리
hyeffie Feb 8, 2024
0921887
Merge branch 'step4/first-design-fork' into develop
hyeffie Feb 8, 2024
0fca4b4
fix: 머지 과정 중 누락된 코드 추가
Changhyun-Kyle Feb 8, 2024
2e1dabc
refine: 코드 단순화
hyeffie Feb 12, 2024
2a65193
remove: 불필요한 코드 제거
hyeffie Feb 12, 2024
0e24dbe
fix: semaphore signal 누락된 부분 수정
hyeffie Feb 13, 2024
9172fd7
Merge branch 'step4/feedback' into develop
hyeffie Feb 13, 2024
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
1 change: 1 addition & 0 deletions BankManagerConsoleApp/.swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ disabled_rules:
- trailing_comma
- class_delegate_protocol
- sorted_imports
- closure_parameter_position

force_unwrapping:
severity: error
Expand Down
139 changes: 31 additions & 108 deletions BankManagerConsoleApp/BankManagerConsoleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,15 @@
objects = {

/* Begin PBXBuildFile section */
2776CBD12B6B844F00EF7155 /* TextInputReadable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2776CBD02B6B844F00EF7155 /* TextInputReadable.swift */; };
2776CBD32B6B852F00EF7155 /* BankManagerAppMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2776CBD22B6B852F00EF7155 /* BankManagerAppMenu.swift */; };
2776CBD52B6B854C00EF7155 /* IOError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2776CBD42B6B854C00EF7155 /* IOError.swift */; };
2776CBD72B6B8BE900EF7155 /* LinkedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2776CBD62B6B8BE900EF7155 /* LinkedList.swift */; };
2776CBD92B6B8C1400EF7155 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2776CBD82B6B8C1400EF7155 /* Node.swift */; };
C7694E7A259C3EC00053667F /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7694E79259C3EC00053667F /* main.swift */; };
C7D65D1B259C8190005510E0 /* BankManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7D65D1A259C8190005510E0 /* BankManager.swift */; };
F475FC6C2B6CC0EF00B0E859 /* BankManagerAppError.swift in Sources */ = {isa = PBXBuildFile; fileRef = F475FC6B2B6CC0EF00B0E859 /* BankManagerAppError.swift */; };
F4EC3C312B6A57B0006C9D11 /* BankTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C302B6A57B0006C9D11 /* BankTask.swift */; };
F4EC3C332B6A5B82006C9D11 /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C322B6A5B82006C9D11 /* Queue.swift */; };
F4EC3C352B6A6BD1006C9D11 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C342B6A6BD1006C9D11 /* Order.swift */; };
F4EC3C392B6A6C05006C9D11 /* TaskManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C382B6A6C05006C9D11 /* TaskManager.swift */; };
F4EC3C3B2B6A6C18006C9D11 /* BankerEnqueuable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C3A2B6A6C18006C9D11 /* BankerEnqueuable.swift */; };
F4EC3C3F2B6A6CC3006C9D11 /* BankRunnable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C3E2B6A6CC3006C9D11 /* BankRunnable.swift */; };
F4EC3C412B6A6CE6006C9D11 /* TaskManagable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C402B6A6CE6006C9D11 /* TaskManagable.swift */; };
F4EC3C432B6A6D06006C9D11 /* Banker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C422B6A6D06006C9D11 /* Banker.swift */; };
F4EC3C452B6A6D15006C9D11 /* ClientTaskHandlable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C442B6A6D15006C9D11 /* ClientTaskHandlable.swift */; };
F4EC3C472B6A6D6F006C9D11 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C462B6A6D6F006C9D11 /* Client.swift */; };
F4EC3C492B6A70E7006C9D11 /* ClientEnqueuable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C482B6A70E7006C9D11 /* ClientEnqueuable.swift */; };
F4EC3C4B2B6A71E0006C9D11 /* TextOutputDisplayable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C4A2B6A71E0006C9D11 /* TextOutputDisplayable.swift */; };
F4EC3C4D2B6A71F8006C9D11 /* ConsoleManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C4C2B6A71F8006C9D11 /* ConsoleManager.swift */; };
F4EC3C502B6B6701006C9D11 /* BankManagerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C4F2B6B6701006C9D11 /* BankManagerApp.swift */; };
F4EC3C522B6B7F9A006C9D11 /* TicketDispenser.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C512B6B7F9A006C9D11 /* TicketDispenser.swift */; };
F4EC3C542B6B7FAE006C9D11 /* TicketProvidable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C532B6B7FAE006C9D11 /* TicketProvidable.swift */; };
F46FA2A42B63A46A00787C3F /* BankManagerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F46FA2A32B63A46A00787C3F /* BankManagerApp.swift */; };
F46FA2A82B66309000787C3F /* ConsoleManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F46FA2A72B66309000787C3F /* ConsoleManager.swift */; };
F46FA2AA2B6630B200787C3F /* TextInputReadable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F46FA2A92B6630B200787C3F /* TextInputReadable.swift */; };
F46FA2AC2B6630CF00787C3F /* BankManagerAppMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = F46FA2AB2B6630CF00787C3F /* BankManagerAppMenu.swift */; };
F46FA2AE2B6630E300787C3F /* IOError.swift in Sources */ = {isa = PBXBuildFile; fileRef = F46FA2AD2B6630E300787C3F /* IOError.swift */; };
F4EC3C292B6784BB006C9D11 /* TextOutputDisplayable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EC3C282B6784BB006C9D11 /* TextOutputDisplayable.swift */; };
F4EDF9F72B5F749400C3E54C /* QueueTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EDF9F62B5F749400C3E54C /* QueueTest.swift */; };
F4EDFA022B5FADF200C3E54C /* LinkedListTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4EDFA012B5FADF200C3E54C /* LinkedListTest.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -46,31 +31,18 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
2776CBD02B6B844F00EF7155 /* TextInputReadable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextInputReadable.swift; sourceTree = "<group>"; };
2776CBD22B6B852F00EF7155 /* BankManagerAppMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankManagerAppMenu.swift; sourceTree = "<group>"; };
2776CBD42B6B854C00EF7155 /* IOError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IOError.swift; sourceTree = "<group>"; };
2776CBD62B6B8BE900EF7155 /* LinkedList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkedList.swift; sourceTree = "<group>"; };
2776CBD82B6B8C1400EF7155 /* Node.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Node.swift; sourceTree = "<group>"; };
C7694E76259C3EC00053667F /* BankManagerConsoleApp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = BankManagerConsoleApp; sourceTree = BUILT_PRODUCTS_DIR; };
C7694E79259C3EC00053667F /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
C7D65D1A259C8190005510E0 /* BankManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BankManager.swift; sourceTree = "<group>"; };
F475FC6B2B6CC0EF00B0E859 /* BankManagerAppError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankManagerAppError.swift; sourceTree = "<group>"; };
F4EC3C302B6A57B0006C9D11 /* BankTask.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankTask.swift; sourceTree = "<group>"; };
F4EC3C322B6A5B82006C9D11 /* Queue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Queue.swift; sourceTree = "<group>"; };
F4EC3C342B6A6BD1006C9D11 /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = "<group>"; };
F4EC3C382B6A6C05006C9D11 /* TaskManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskManager.swift; sourceTree = "<group>"; };
F4EC3C3A2B6A6C18006C9D11 /* BankerEnqueuable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankerEnqueuable.swift; sourceTree = "<group>"; };
F4EC3C3E2B6A6CC3006C9D11 /* BankRunnable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankRunnable.swift; sourceTree = "<group>"; };
F4EC3C402B6A6CE6006C9D11 /* TaskManagable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskManagable.swift; sourceTree = "<group>"; };
F4EC3C422B6A6D06006C9D11 /* Banker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Banker.swift; sourceTree = "<group>"; };
F4EC3C442B6A6D15006C9D11 /* ClientTaskHandlable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientTaskHandlable.swift; sourceTree = "<group>"; };
F4EC3C462B6A6D6F006C9D11 /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = "<group>"; };
F4EC3C482B6A70E7006C9D11 /* ClientEnqueuable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientEnqueuable.swift; sourceTree = "<group>"; };
F4EC3C4A2B6A71E0006C9D11 /* TextOutputDisplayable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextOutputDisplayable.swift; sourceTree = "<group>"; };
F4EC3C4C2B6A71F8006C9D11 /* ConsoleManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleManager.swift; sourceTree = "<group>"; };
F4EC3C4F2B6B6701006C9D11 /* BankManagerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankManagerApp.swift; sourceTree = "<group>"; };
F4EC3C512B6B7F9A006C9D11 /* TicketDispenser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TicketDispenser.swift; sourceTree = "<group>"; };
F4EC3C532B6B7FAE006C9D11 /* TicketProvidable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TicketProvidable.swift; sourceTree = "<group>"; };
F447FC382B5E50C7002A2692 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = "<group>"; };
F46FA2A32B63A46A00787C3F /* BankManagerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankManagerApp.swift; sourceTree = "<group>"; };
F46FA2A72B66309000787C3F /* ConsoleManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConsoleManager.swift; sourceTree = "<group>"; };
F46FA2A92B6630B200787C3F /* TextInputReadable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextInputReadable.swift; sourceTree = "<group>"; };
F46FA2AB2B6630CF00787C3F /* BankManagerAppMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankManagerAppMenu.swift; sourceTree = "<group>"; };
F46FA2AD2B6630E300787C3F /* IOError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IOError.swift; sourceTree = "<group>"; };
F4EC3C282B6784BB006C9D11 /* TextOutputDisplayable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextOutputDisplayable.swift; sourceTree = "<group>"; };
F4EDF9F42B5F749400C3E54C /* BankManagerConsoleAppTest.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BankManagerConsoleAppTest.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
F4EDF9F62B5F749400C3E54C /* QueueTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueueTest.swift; sourceTree = "<group>"; };
F4EDFA012B5FADF200C3E54C /* LinkedListTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkedListTest.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -114,35 +86,14 @@
2776CBDC2B6B8CB400EF7155 /* View */ = {
isa = PBXGroup;
children = (
2776CBD42B6B854C00EF7155 /* IOError.swift */,
F4EC3C4C2B6A71F8006C9D11 /* ConsoleManager.swift */,
C7694E79259C3EC00053667F /* main.swift */,
F4EC3C2A2B678562006C9D11 /* App */,
F4EC3C272B678463006C9D11 /* View */,
);
path = View;
sourceTree = "<group>";
};
2776CBDD2B6B8D4300EF7155 /* Model */ = {
isa = PBXGroup;
children = (
F4EC3C512B6B7F9A006C9D11 /* TicketDispenser.swift */,
C7D65D1A259C8190005510E0 /* BankManager.swift */,
F4EC3C382B6A6C05006C9D11 /* TaskManager.swift */,
F4EC3C422B6A6D06006C9D11 /* Banker.swift */,
2776CBDE2B6B8D5000EF7155 /* Value */,
);
path = Model;
sourceTree = "<group>";
};
2776CBDE2B6B8D5000EF7155 /* Value */ = {
isa = PBXGroup;
children = (
F4EC3C302B6A57B0006C9D11 /* BankTask.swift */,
F4EC3C342B6A6BD1006C9D11 /* Order.swift */,
F4EC3C462B6A6D6F006C9D11 /* Client.swift */,
);
path = Value;
sourceTree = "<group>";
};
C7694E6D259C3EC00053667F = {
F4EC3C272B678463006C9D11 /* View */ = {
isa = PBXGroup;
children = (
C7694E78259C3EC00053667F /* BankManagerConsoleApp */,
Expand All @@ -158,20 +109,7 @@
name = Products;
sourceTree = "<group>";
};
C7694E78259C3EC00053667F /* BankManagerConsoleApp */ = {
isa = PBXGroup;
children = (
C7694E79259C3EC00053667F /* main.swift */,
2776CBDB2B6B8C8C00EF7155 /* App */,
2776CBDD2B6B8D4300EF7155 /* Model */,
2776CBDC2B6B8CB400EF7155 /* View */,
F4EC3C4E2B6A72C6006C9D11 /* Protocol */,
2776CBDA2B6B8C1F00EF7155 /* Utils */,
);
path = BankManagerConsoleApp;
sourceTree = "<group>";
};
F4EC3C4E2B6A72C6006C9D11 /* Protocol */ = {
F4EDF9F52B5F749400C3E54C /* BankManagerConsoleAppTest */ = {
isa = PBXGroup;
children = (
F4EC3C3A2B6A6C18006C9D11 /* BankerEnqueuable.swift */,
Expand Down Expand Up @@ -297,37 +235,22 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F4EC3C3F2B6A6CC3006C9D11 /* BankRunnable.swift in Sources */,
2776CBD92B6B8C1400EF7155 /* Node.swift in Sources */,
F4EC3C502B6B6701006C9D11 /* BankManagerApp.swift in Sources */,
F4EC3C432B6A6D06006C9D11 /* Banker.swift in Sources */,
F46FA2AC2B6630CF00787C3F /* BankManagerAppMenu.swift in Sources */,
F46FA2AE2B6630E300787C3F /* IOError.swift in Sources */,
F46FA2AA2B6630B200787C3F /* TextInputReadable.swift in Sources */,
F46FA2A42B63A46A00787C3F /* BankManagerApp.swift in Sources */,
C7694E7A259C3EC00053667F /* main.swift in Sources */,
F4EC3C542B6B7FAE006C9D11 /* TicketProvidable.swift in Sources */,
2776CBD72B6B8BE900EF7155 /* LinkedList.swift in Sources */,
F4EC3C312B6A57B0006C9D11 /* BankTask.swift in Sources */,
F4EC3C4B2B6A71E0006C9D11 /* TextOutputDisplayable.swift in Sources */,
F4EC3C492B6A70E7006C9D11 /* ClientEnqueuable.swift in Sources */,
F4EC3C452B6A6D15006C9D11 /* ClientTaskHandlable.swift in Sources */,
F4EC3C3B2B6A6C18006C9D11 /* BankerEnqueuable.swift in Sources */,
2776CBD32B6B852F00EF7155 /* BankManagerAppMenu.swift in Sources */,
F4EC3C472B6A6D6F006C9D11 /* Client.swift in Sources */,
F4EC3C352B6A6BD1006C9D11 /* Order.swift in Sources */,
2776CBD52B6B854C00EF7155 /* IOError.swift in Sources */,
2776CBD12B6B844F00EF7155 /* TextInputReadable.swift in Sources */,
F4EC3C412B6A6CE6006C9D11 /* TaskManagable.swift in Sources */,
F4EC3C522B6B7F9A006C9D11 /* TicketDispenser.swift in Sources */,
C7D65D1B259C8190005510E0 /* BankManager.swift in Sources */,
F4EC3C392B6A6C05006C9D11 /* TaskManager.swift in Sources */,
F4EC3C4D2B6A71F8006C9D11 /* ConsoleManager.swift in Sources */,
F475FC6C2B6CC0EF00B0E859 /* BankManagerAppError.swift in Sources */,
F4EC3C332B6A5B82006C9D11 /* Queue.swift in Sources */,
F4EC3C292B6784BB006C9D11 /* TextOutputDisplayable.swift in Sources */,
F46FA2A82B66309000787C3F /* ConsoleManager.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F4EDF9F02B5F749400C3E54C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F4EDF9F72B5F749400C3E54C /* QueueTest.swift in Sources */,
F4EDFA022B5FADF200C3E54C /* LinkedListTest.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,42 @@
//

final class BankManagerApp {
private let input: TextInputReadable

private let output: TextOutputDisplayable

private var isRunning: Bool = true

init(inputHandler: TextInputReadable, outputHandler: TextOutputDisplayable) {
self.input = inputHandler
self.output = outputHandler
}

func start() {
while self.isRunning {
startLoop()
}
startBank()
}
}

private extension BankManagerApp {
func startLoop() {
self.output.display(output: BankManagerAppMenu.allMenusPrompt)
do {
let input = try self.input.readInput(prompt: "입력:")
let menu = try BankManagerAppMenu(input: input)
handle(menu: menu)
} catch {
handle(error: error)
}
}

func startBank() throws {
guard let clientCount = (10...30).randomElement() else { throw BankManagerAppError.outOfIndex }
let dispenser = try TicketDispenser(totalClientCount: clientCount)

let orders = [
Order(taskType: .loan, bankerCount: 1),
Order(taskType: .deposit, bankerCount: 2),
func startBank() {
let tasks: [BankTask: ClientQueueManagable] = [
.loan: ClientManager(),
.deposit: ClientManager(),
]

let bankManager = BankManager(
textOut: self.output,
dispenser: dispenser

let orders: [BankTask: Int] = [.loan: 2, .deposit: 3]
let bankers = makeBankers(
tasks: tasks,
orders: orders
)

bankManager.runBank(with: orders, numberOfClient: clientCount)
BankManager(
bankers: bankers,
clientManager: tasks
).start()
}

func handle(menu: BankManagerAppMenu) {
switch menu {
case .open:
do {
try startBank()
} catch {
handle(error: error)
// return

func makeBankers(
tasks: [BankTask: any ClientQueueManagable],
orders: [BankTask: Int]
) -> [Banker] {
var result = [Banker]()
for (type, bankerCount) in orders {
(1...bankerCount).forEach { _ in
guard let clientManager = tasks[type] else { return }
let banker = Banker(clientManager: clientManager)
result.append(banker)
}
case .end:
self.isRunning = false
}
}

func handle(error: Error) {
self.output.display(output: error.localizedDescription)
return result
}
}

This file was deleted.

11 changes: 0 additions & 11 deletions BankManagerConsoleApp/BankManagerConsoleApp/Model/Client.swift

This file was deleted.

This file was deleted.

Loading