Skip to content

Commit

Permalink
Merge pull request #360 from MaeumGaGym/refactoring/#359-architectureRF
Browse files Browse the repository at this point in the history
ADD :: [#359] 작업 방식 예시 추가
  • Loading branch information
Eunho0922 authored Jul 4, 2024
2 parents c8bf265 + 329dccc commit 170ee3f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Projects/Domain/Sources/UseCase/HomeUseCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public protocol HomeUseCase {
}

public class DefaultHomeUseCase {

private let repository: HomeRepositoryInterface
private let disposeBag = DisposeBag()

Expand Down
1 change: 0 additions & 1 deletion Projects/Domain/Sources/UseCase/PostureUseCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<PoseRecommandModel>()
public let partData = PublishSubject<PosturePartModel>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class HomeViewModel: HomeViewModelType {

private let useCase: HomeUseCase

private let homeRepository: HomeRepositoryInterface

private let isServiceAvailableSubject = PublishSubject<Bool>()
private let motivationMessageSubject = PublishSubject<MotivationMessageModel>()
private let stepNumberSubject = PublishSubject<StepModel>()
Expand All @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 170ee3f

Please sign in to comment.