-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Fix] 채팅 관련 QA해결 #137
[Fix] 채팅 관련 QA해결 #137
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
whiteboardRepository: whiteboardRepository, | ||
profileRepository: profileRepository) | ||
let profileUseCase = ProfileUseCase(repository: profileRepository) | ||
let manageWhieboardObjectUseCase = ManageWhiteboardObjectUseCase( | ||
let manageWhiteboardObjectUseCase = ManageWhiteboardObjectUseCase( | ||
profileRepository: profileRepository, | ||
whiteboardObjectRepository: whiteboardObjectRepository, | ||
whiteboardRepository: whiteboardRepository, | ||
|
@@ -54,30 +54,27 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
textFieldDefaultSize: CGSize(width: 200, height: 50)) | ||
let drawObjectUseCase = DrawObjectUseCase() | ||
let gameObjectUseCase = GameObjectUseCase(repository: GameRepository(persistenceService: PersistenceService())) | ||
let addPhotoUseCase = PhotoUseCase(photoRepository: photoRepository) | ||
let photoUseCase = PhotoUseCase(photoRepository: photoRepository) | ||
let chatUseCase = ChatUseCase(chatRepository: chatRepository) | ||
|
||
let whiteboardObjectViewFactory = WhiteboardObjectViewFactory() | ||
|
||
let whiteboardListViewModel = WhiteboardListViewModel(whiteboardUseCase: whiteboardUseCase) | ||
let whiteboardViewModel = WhiteboardViewModel( | ||
whiteboardUseCase: whiteboardUseCase, | ||
addPhotoUseCase: addPhotoUseCase, | ||
drawObjectUseCase: drawObjectUseCase, | ||
textObjectUseCase: textObjectUseCase, | ||
chatUseCase: chatUseCase, | ||
gameObjectUseCase: gameObjectUseCase, | ||
managemanageWhiteboardToolUseCase: manageWhiteboardToolUseCase, | ||
manageWhiteboardObjectUseCase: manageWhieboardObjectUseCase) | ||
let profileViewModel = ProfileViewModel(profileUseCase: profileUseCase) | ||
|
||
let whiteboardListViewController = WhiteboardListViewController( | ||
viewModel: whiteboardListViewModel, | ||
whiteboardViewModel: whiteboardViewModel, | ||
whiteboardObjectViewFactory: whiteboardObjectViewFactory, | ||
profileViewModel: profileViewModel, | ||
profileRepository: profileRepository, | ||
chatUseCase: chatUseCase) | ||
whiteboardUseCase: whiteboardUseCase, | ||
photoUseCase: photoUseCase, | ||
drawObjectUseCase: drawObjectUseCase, | ||
textObjectUseCase: textObjectUseCase, | ||
chatUseCase: chatUseCase, | ||
gameObjectUseCase: gameObjectUseCase, | ||
manageWhiteboardToolUseCase: manageWhiteboardToolUseCase, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 음음... 좋습니다 👍👍👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅋㅋ리팩토링 하면서 주입관련해서 같이 고민 해봅시다!! |
||
manageWhiteboardObjectUseCase: manageWhiteboardObjectUseCase) | ||
|
||
let window = UIWindow(windowScene: windowScene) | ||
let navigationController = UINavigationController(rootViewController: whiteboardListViewController) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,10 +42,10 @@ public final class WhiteboardViewModel: ViewModel { | |
|
||
private(set) var output: Output | ||
private let whiteboardUseCase: WhiteboardUseCaseInterface | ||
private let photoUseCase: PhotoUseCase | ||
private let photoUseCase: PhotoUseCaseInterface | ||
private let drawObjectUseCase: DrawObjectUseCaseInterface | ||
private let textObjectUseCase: TextObjectUseCaseInterface | ||
private let chatUseCase: ChatUseCase | ||
private let chatUseCase: ChatUseCaseInterface | ||
private let gameObjectUseCase: GameObjectUseCaseInterface | ||
private let manageWhiteboardToolUseCase: ManageWhiteboardToolUseCaseInterface | ||
private let manageWhiteboardObjectUseCase: ManageWhiteboardObjectUseCaseInterface | ||
|
@@ -55,21 +55,21 @@ public final class WhiteboardViewModel: ViewModel { | |
|
||
public init( | ||
whiteboardUseCase: WhiteboardUseCaseInterface, | ||
addPhotoUseCase: PhotoUseCase, | ||
photoUseCase: PhotoUseCaseInterface, | ||
drawObjectUseCase: DrawObjectUseCaseInterface, | ||
textObjectUseCase: TextObjectUseCaseInterface, | ||
chatUseCase: ChatUseCase, | ||
chatUseCase: ChatUseCaseInterface, | ||
gameObjectUseCase: GameObjectUseCaseInterface, | ||
managemanageWhiteboardToolUseCase: ManageWhiteboardToolUseCaseInterface, | ||
manageWhiteboardToolUseCase: ManageWhiteboardToolUseCaseInterface, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅋㅋㅋㅋㅋㅋ managemange 이번에는 확실히 죽인걸루 ~~ |
||
manageWhiteboardObjectUseCase: ManageWhiteboardObjectUseCaseInterface | ||
) { | ||
self.whiteboardUseCase = whiteboardUseCase | ||
self.photoUseCase = addPhotoUseCase | ||
self.photoUseCase = photoUseCase | ||
self.drawObjectUseCase = drawObjectUseCase | ||
self.textObjectUseCase = textObjectUseCase | ||
self.chatUseCase = chatUseCase | ||
self.gameObjectUseCase = gameObjectUseCase | ||
self.manageWhiteboardToolUseCase = managemanageWhiteboardToolUseCase | ||
self.manageWhiteboardToolUseCase = manageWhiteboardToolUseCase | ||
self.manageWhiteboardObjectUseCase = manageWhiteboardObjectUseCase | ||
selectedObjectSubject = CurrentValueSubject(nil) | ||
imageSubject = PassthroughSubject<(id: UUID, imageData: Data), Never>() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,26 +61,44 @@ public final class WhiteboardListViewController: UIViewController { | |
private let viewModel: WhiteboardListViewModel | ||
private var cancellables = Set<AnyCancellable>() | ||
|
||
private let whiteboardViewModel: WhiteboardViewModel | ||
private let whiteboardObjectViewFactory: WhiteboardObjectViewFactoryable | ||
private let profileViewModel: ProfileViewModel | ||
private let profileRepository: ProfileRepositoryInterface | ||
private let whiteboardUseCase: WhiteboardUseCaseInterface | ||
private let photoUseCase: PhotoUseCaseInterface | ||
private let drawObjectUseCase: DrawObjectUseCaseInterface | ||
private let textObjectUseCase: TextObjectUseCaseInterface | ||
private let chatUseCase: ChatUseCaseInterface | ||
private let gameObjectUseCase: GameObjectUseCaseInterface | ||
private let manageWhiteboardToolUseCase: ManageWhiteboardToolUseCaseInterface | ||
private let manageWhiteboardObjectUseCase: ManageWhiteboardObjectUseCaseInterface | ||
|
||
public init( | ||
viewModel: WhiteboardListViewModel, | ||
whiteboardViewModel: WhiteboardViewModel, | ||
whiteboardObjectViewFactory: WhiteboardObjectViewFactoryable, | ||
profileViewModel: ProfileViewModel, | ||
profileRepository: ProfileRepositoryInterface, | ||
chatUseCase: ChatUseCaseInterface | ||
whiteboardUseCase: WhiteboardUseCaseInterface, | ||
photoUseCase: PhotoUseCaseInterface, | ||
drawObjectUseCase: DrawObjectUseCaseInterface, | ||
textObjectUseCase: TextObjectUseCaseInterface, | ||
chatUseCase: ChatUseCaseInterface, | ||
gameObjectUseCase: GameObjectUseCaseInterface, | ||
manageWhiteboardToolUseCase: ManageWhiteboardToolUseCaseInterface, | ||
manageWhiteboardObjectUseCase: ManageWhiteboardObjectUseCaseInterface | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 민족 대이동을 하셨군요.. |
||
) { | ||
self.viewModel = viewModel | ||
self.whiteboardViewModel = whiteboardViewModel | ||
self.whiteboardObjectViewFactory = whiteboardObjectViewFactory | ||
self.profileViewModel = profileViewModel | ||
self.profileRepository = profileRepository | ||
self.whiteboardUseCase = whiteboardUseCase | ||
self.photoUseCase = photoUseCase | ||
self.drawObjectUseCase = drawObjectUseCase | ||
self.textObjectUseCase = textObjectUseCase | ||
self.chatUseCase = chatUseCase | ||
self.gameObjectUseCase = gameObjectUseCase | ||
self.manageWhiteboardToolUseCase = manageWhiteboardToolUseCase | ||
self.manageWhiteboardObjectUseCase = manageWhiteboardObjectUseCase | ||
super.init(nibName: nil, bundle: nil) | ||
} | ||
|
||
|
@@ -113,12 +131,27 @@ public final class WhiteboardListViewController: UIViewController { | |
self?.viewModel.action(input: .createWhiteboard) | ||
|
||
guard | ||
let whiteboardViewModel = self?.whiteboardViewModel, | ||
let whiteboardObjectViewFactory = self?.whiteboardObjectViewFactory, | ||
let profileRepository = self?.profileRepository, | ||
let chatUseCase = self?.chatUseCase | ||
let whiteboardUseCase = self?.whiteboardUseCase, | ||
let photoUseCase = self?.photoUseCase, | ||
let drawObjectUseCase = self?.drawObjectUseCase, | ||
let textObjectUseCase = self?.textObjectUseCase, | ||
let chatUseCase = self?.chatUseCase, | ||
let gameObjectUseCase = self?.gameObjectUseCase, | ||
let manageWhiteboardToolUseCase = self?.manageWhiteboardToolUseCase, | ||
let manageWhiteboardObjectUseCase = self?.manageWhiteboardObjectUseCase | ||
else { return } | ||
|
||
let whiteboardViewModel = WhiteboardViewModel( | ||
whiteboardUseCase: whiteboardUseCase, | ||
photoUseCase: photoUseCase, | ||
drawObjectUseCase: drawObjectUseCase, | ||
textObjectUseCase: textObjectUseCase, | ||
chatUseCase: chatUseCase, | ||
gameObjectUseCase: gameObjectUseCase, | ||
manageWhiteboardToolUseCase: manageWhiteboardToolUseCase, | ||
manageWhiteboardObjectUseCase: manageWhiteboardObjectUseCase) | ||
let whiteboardViewController = WhiteboardViewController( | ||
viewModel: whiteboardViewModel, | ||
objectViewFactory: whiteboardObjectViewFactory, | ||
|
@@ -280,6 +313,15 @@ extension WhiteboardListViewController: UICollectionViewDelegate { | |
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { | ||
guard let selectedWhiteboard = dataSource?.itemIdentifier(for: indexPath) else { return } | ||
viewModel.action(input: .joinWhiteboard(whiteboard: selectedWhiteboard)) | ||
let whiteboardViewModel = WhiteboardViewModel( | ||
whiteboardUseCase: whiteboardUseCase, | ||
photoUseCase: photoUseCase, | ||
drawObjectUseCase: drawObjectUseCase, | ||
textObjectUseCase: textObjectUseCase, | ||
chatUseCase: chatUseCase, | ||
gameObjectUseCase: gameObjectUseCase, | ||
manageWhiteboardToolUseCase: manageWhiteboardToolUseCase, | ||
manageWhiteboardObjectUseCase: manageWhiteboardObjectUseCase) | ||
let whiteboardViewController = WhiteboardViewController( | ||
viewModel: whiteboardViewModel, | ||
objectViewFactory: whiteboardObjectViewFactory, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
하 이런 디테일 놓친거까지 챙겨주다니.. 그저 갓