From c504a9c338b5361d3602e88bb31acdbdf5a84b13 Mon Sep 17 00:00:00 2001 From: Zizi_Kim Date: Tue, 16 Jan 2024 14:33:46 +0900 Subject: [PATCH] =?UTF-8?q?delete:=20=ED=99=94=EB=A9=B4=20=EC=A7=84?= =?UTF-8?q?=EC=9E=85=20=EC=8B=9C=20memberInfo=20=ED=98=B8=EC=B6=9C=20?= =?UTF-8?q?=EA=B5=AC=EB=AC=B8=20=EC=82=AD=EC=A0=9C=20(#279)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dependency/FamilyManagementDIContainer.swift | 9 --------- .../Reactor/FamilyManagementViewReactor.swift | 14 -------------- .../FamilyManagementViewController.swift | 5 ----- .../Home/Dependency/HomeDIContainer.swift | 12 ++---------- .../Home/Reactor/HomeViewReactor.swift | 12 +----------- .../Home/ViewControllers/HomeViewController.swift | 5 ----- 6 files changed, 3 insertions(+), 54 deletions(-) diff --git a/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/Dependency/FamilyManagementDIContainer.swift b/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/Dependency/FamilyManagementDIContainer.swift index 139824d46..5f56c0622 100644 --- a/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/Dependency/FamilyManagementDIContainer.swift +++ b/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/Dependency/FamilyManagementDIContainer.swift @@ -25,14 +25,6 @@ public final class FamilyManagementDIContainer { return FamilyManagementViewController(reactor: makeReactor()) } - public func makeMeRepository() -> MeRepositoryProtocol { - return MeAPIs.Worker() - } - - public func makeMeUseCase() -> MeUseCaseProtocol { - return MeUseCase(meRepository: makeMeRepository()) - } - public func makeFamilyUseCase() -> FamilyViewUseCaseProtocol { return FamilyViewUseCase(familyRepository: makeFamilyRepository()) } @@ -43,7 +35,6 @@ public final class FamilyManagementDIContainer { public func makeReactor() -> FamilyManagementViewReactor { return FamilyManagementViewReactor( - meUseCase: makeMeUseCase(), familyUseCase: makeFamilyUseCase(), provider: globalState ) diff --git a/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/Reactor/FamilyManagementViewReactor.swift b/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/Reactor/FamilyManagementViewReactor.swift index 7e06cd6b9..25eef6992 100644 --- a/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/Reactor/FamilyManagementViewReactor.swift +++ b/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/Reactor/FamilyManagementViewReactor.swift @@ -18,7 +18,6 @@ public final class FamilyManagementViewReactor: Reactor { // MARK: - Action public enum Action { case didTapShareButton - case fetchMeInfo case fetchFamilyMemebers } @@ -46,7 +45,6 @@ public final class FamilyManagementViewReactor: Reactor { // MARK: - Properties public let initialState: State - public let meUseCase: MeUseCaseProtocol public let familyUseCase: FamilyViewUseCaseProtocol public let provider: GlobalStateProviderProtocol @@ -54,7 +52,6 @@ public final class FamilyManagementViewReactor: Reactor { // MARK: - Intializer init( - meUseCase: MeUseCaseProtocol, familyUseCase: FamilyViewUseCaseProtocol, provider: GlobalStateProviderProtocol ) { @@ -68,7 +65,6 @@ public final class FamilyManagementViewReactor: Reactor { shouldShowProgressView: false ) - self.meUseCase = meUseCase self.familyUseCase = familyUseCase self.provider = provider } @@ -102,16 +98,6 @@ public final class FamilyManagementViewReactor: Reactor { Observable.just(.setProgressView(false)) ) - case .fetchMeInfo: - return meUseCase.getMemberInfo() - .asObservable() - .flatMap { - guard let familyId: String = $0?.familyId else { - return Observable.just(.injectFamilyId(nil)) - } - return Observable.just(.injectFamilyId(familyId)) - } - case .fetchFamilyMemebers: return familyUseCase.executeFetchFamilyMembers() .withUnretained(self) diff --git a/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/ViewController/FamilyManagementViewController.swift b/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/ViewController/FamilyManagementViewController.swift index 28f1eba77..decbe655a 100644 --- a/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/ViewController/FamilyManagementViewController.swift +++ b/14th-team5-iOS/App/Sources/Presentation/FamilyManagement/ViewController/FamilyManagementViewController.swift @@ -57,11 +57,6 @@ public final class FamilyManagementViewController: BaseViewController.just(()) - .map { Reactor.Action.fetchMeInfo } - .bind(to: reactor.action) - .disposed(by: disposeBag) - Observable.just(()) .map { Reactor.Action.fetchFamilyMemebers } .bind(to: reactor.action) diff --git a/14th-team5-iOS/App/Sources/Presentation/Home/Dependency/HomeDIContainer.swift b/14th-team5-iOS/App/Sources/Presentation/Home/Dependency/HomeDIContainer.swift index 8559cfc55..0c95bdc7b 100644 --- a/14th-team5-iOS/App/Sources/Presentation/Home/Dependency/HomeDIContainer.swift +++ b/14th-team5-iOS/App/Sources/Presentation/Home/Dependency/HomeDIContainer.swift @@ -26,19 +26,11 @@ public final class HomeDIContainer { public func makeFamilyRepository() -> SearchFamilyRepository { return FamilyAPIs.Worker() } - - public func makeMeRepository() -> MeRepositoryProtocol { - return MeAPIs.Worker() - } - + public func makeInviteFamilyRepository() -> FamilyRepositoryProtocol { return FamilyRepository() } - func makeMeUseCase() -> MeUseCaseProtocol { - return MeUseCase(meRepository: makeMeRepository()) - } - func makePostUseCase() -> PostListUseCaseProtocol { return PostListUseCase(postListRepository: makePostRepository()) } @@ -52,7 +44,7 @@ public final class HomeDIContainer { } public func makeReactor() -> Reactor { - return HomeViewReactor(meRepository: makeMeUseCase(), postRepository: makePostUseCase()) + return HomeViewReactor(postRepository: makePostUseCase()) } } diff --git a/14th-team5-iOS/App/Sources/Presentation/Home/Reactor/HomeViewReactor.swift b/14th-team5-iOS/App/Sources/Presentation/Home/Reactor/HomeViewReactor.swift index cf368e7bb..e9738ef24 100644 --- a/14th-team5-iOS/App/Sources/Presentation/Home/Reactor/HomeViewReactor.swift +++ b/14th-team5-iOS/App/Sources/Presentation/Home/Reactor/HomeViewReactor.swift @@ -16,7 +16,6 @@ import RxDataSources public final class HomeViewReactor: Reactor { public enum Action { - case fetchMeInfo case getTodayPostList case refreshCollectionview case startTimer @@ -48,11 +47,9 @@ public final class HomeViewReactor: Reactor { } public let initialState: State = State() - private let meRepository: MeUseCaseProtocol private let postRepository: PostListUseCaseProtocol - init(meRepository: MeUseCaseProtocol, postRepository: PostListUseCaseProtocol) { - self.meRepository = meRepository + init(postRepository: PostListUseCaseProtocol) { self.postRepository = postRepository } } @@ -60,13 +57,6 @@ public final class HomeViewReactor: Reactor { extension HomeViewReactor { public func mutate(action: Action) -> Observable { switch action { - case .fetchMeInfo: - return meRepository.getMemberInfo() - .asObservable() - .flatMap { _ in - return Observable.empty() - } - case .getTodayPostList: let query: PostListQuery = PostListQuery(page: 1, size: 20, date: Date().toFormatString(with: "YYYY-MM-DD"), memberId: "", sort: .desc) return postRepository.excute(query: query) diff --git a/14th-team5-iOS/App/Sources/Presentation/Home/ViewControllers/HomeViewController.swift b/14th-team5-iOS/App/Sources/Presentation/Home/ViewControllers/HomeViewController.swift index 077ead444..2332f609d 100644 --- a/14th-team5-iOS/App/Sources/Presentation/Home/ViewControllers/HomeViewController.swift +++ b/14th-team5-iOS/App/Sources/Presentation/Home/ViewControllers/HomeViewController.swift @@ -172,11 +172,6 @@ extension HomeViewController { postCollectionView.rx.setDelegate(self) .disposed(by: disposeBag) - Observable.just(()) - .map { Reactor.Action.fetchMeInfo } - .bind(to: reactor.action) - .disposed(by: disposeBag) - Observable.just(()) .map { Reactor.Action.startTimer } .bind(to: reactor.action)