From 329dcccf17f2c588e1536e9245d5e0fb554a47ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=80=ED=98=B8?= <127753071+Eunho0922@users.noreply.github.com> Date: Thu, 4 Jul 2024 22:41:25 +0900 Subject: [PATCH] =?UTF-8?q?ADD=20::=20[#359]=20=EC=9E=91=EC=97=85=20?= =?UTF-8?q?=EB=B0=A9=EC=8B=9D=20=EC=98=88=EC=8B=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Domain/Sources/UseCase/HomeUseCase.swift | 2 +- Projects/Domain/Sources/UseCase/PostureUseCase.swift | 1 - .../Sources/HomeScene/ViewModel/HomeViewModel.swift | 7 ++++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Projects/Domain/Sources/UseCase/HomeUseCase.swift b/Projects/Domain/Sources/UseCase/HomeUseCase.swift index 9e1d702e..543d6ed3 100644 --- a/Projects/Domain/Sources/UseCase/HomeUseCase.swift +++ b/Projects/Domain/Sources/UseCase/HomeUseCase.swift @@ -16,7 +16,7 @@ public protocol HomeUseCase { } public class DefaultHomeUseCase { - + private let repository: HomeRepositoryInterface private let disposeBag = DisposeBag() diff --git a/Projects/Domain/Sources/UseCase/PostureUseCase.swift b/Projects/Domain/Sources/UseCase/PostureUseCase.swift index 21635e4f..1bf8285d 100644 --- a/Projects/Domain/Sources/UseCase/PostureUseCase.swift +++ b/Projects/Domain/Sources/UseCase/PostureUseCase.swift @@ -27,7 +27,6 @@ public class DefaultPostureUseCase { private let repository: PostureRepositoryInterface private let disposeBag = DisposeBag() - private let accessToken = TokenManagerImpl().get(key: .accessToken) public let recommandData = PublishSubject() public let partData = PublishSubject() diff --git a/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeViewModel.swift b/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeViewModel.swift index 8a669490..1caa75c3 100644 --- a/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeViewModel.swift +++ b/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeViewModel.swift @@ -14,6 +14,8 @@ public class HomeViewModel: HomeViewModelType { private let useCase: HomeUseCase + private let homeRepository: HomeRepositoryInterface + private let isServiceAvailableSubject = PublishSubject() private let motivationMessageSubject = PublishSubject() private let stepNumberSubject = PublishSubject() @@ -36,8 +38,10 @@ public class HomeViewModel: HomeViewModelType { var extras: Observable<[ExtrasModel]> } - public init(useCase: HomeUseCase) { + public init(disposeBag: DisposeBag, useCase: HomeUseCase, homeRepository: HomeRepositoryInterface) { + self.disposeBag = disposeBag self.useCase = useCase + self.homeRepository = homeRepository } public func transform(_ input: Input, action: (Output) -> Void) -> Output { @@ -60,6 +64,7 @@ public class HomeViewModel: HomeViewModelType { .subscribe(onNext: { owner, _ in HomeStepper.shared.steps.accept(MGStep.homeStepRequired) MGLogger.debug("SeetingButtonTapped") + owner.homeRepository.getMotivationMessage() }).disposed(by: disposeBag) input.getStepNumber