From 85f58f348e0e1939f3b2d3e16444010f0bfdfe25 Mon Sep 17 00:00:00 2001 From: soonny <134983918+soeun11@users.noreply.github.com> Date: Fri, 19 Jun 2026 23:49:42 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[network]=ED=83=88=ED=87=B4=ED=95=98?= =?UTF-8?q?=EA=B8=B0,=20=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=20api=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/DTO/Auth/LogoutRequestDTO.swift | 16 +++++++++++ .../Sources/DTO/Auth/WithdrawRequestDTO.swift | 14 ++++++++++ .../Data/Sources/DTO/Base/BaseResponse.swift | 4 +-- .../Data/Sources/Networking/API/AuthAPI.swift | 14 +++++++--- .../Networking/Service/AuthService.swift | 21 ++++++++++++-- .../RepositoryImpl/AuthRepositoryImpl.swift | 8 ++++-- .../Sources/Repository/AuthRepository.swift | 3 +- .../Sources/UseCase/Auth/LogoutUseCase.swift | 28 +++++++++++++++++++ .../UseCase/Auth/WithDrawUseCase.swift | 6 ++-- FLINT/FLINT/Dependency/DIContainer.swift | 3 ++ .../UseCase/Auth/LogoutUseCaseFactory..swift | 20 +++++++++++++ .../SettingViewControllerFactory+.swift | 19 +++++++++++++ .../WithdrawalViewControllerFactory+.swift | 19 +++++++++++++ .../ViewModel/SettingViewModelFactory.swift | 20 +++++++++++++ .../ViewModel/WithdrawViewModelFactory.swift | 19 +++++++++++++ .../Dependency/ViewControllerFactory.swift | 4 ++- .../Scene/Setting/SettingViewController.swift | 3 +- .../WithdrawViewController.swift | 22 +++++++++++---- .../Scene/Setting/SettingViewModel.swift | 23 +++++++++++---- .../Sources/ViewModel/WithdrawViewModel.swift | 23 ++++++++------- 20 files changed, 250 insertions(+), 39 deletions(-) create mode 100644 FLINT/Data/Sources/DTO/Auth/LogoutRequestDTO.swift create mode 100644 FLINT/Data/Sources/DTO/Auth/WithdrawRequestDTO.swift create mode 100644 FLINT/Domain/Sources/UseCase/Auth/LogoutUseCase.swift create mode 100644 FLINT/FLINT/Dependency/Factory/UseCase/Auth/LogoutUseCaseFactory..swift create mode 100644 FLINT/FLINT/Dependency/Factory/ViewController/SettingViewControllerFactory+.swift create mode 100644 FLINT/FLINT/Dependency/Factory/ViewController/WithdrawalViewControllerFactory+.swift create mode 100644 FLINT/FLINT/Dependency/Factory/ViewModel/SettingViewModelFactory.swift create mode 100644 FLINT/FLINT/Dependency/Factory/ViewModel/WithdrawViewModelFactory.swift diff --git a/FLINT/Data/Sources/DTO/Auth/LogoutRequestDTO.swift b/FLINT/Data/Sources/DTO/Auth/LogoutRequestDTO.swift new file mode 100644 index 00000000..6ed99095 --- /dev/null +++ b/FLINT/Data/Sources/DTO/Auth/LogoutRequestDTO.swift @@ -0,0 +1,16 @@ +// +// LogoutRequestDTO.swift +// Data +// +// Created by 소은 on 6/19/26. +// + +import Foundation + +public struct LogoutRequestDTO: Encodable { + public let refreshToken: String + + public init(refreshToken: String) { + self.refreshToken = refreshToken + } +} diff --git a/FLINT/Data/Sources/DTO/Auth/WithdrawRequestDTO.swift b/FLINT/Data/Sources/DTO/Auth/WithdrawRequestDTO.swift new file mode 100644 index 00000000..992d2e40 --- /dev/null +++ b/FLINT/Data/Sources/DTO/Auth/WithdrawRequestDTO.swift @@ -0,0 +1,14 @@ +// +// WithdrawRequestDTO.swift +// Data +// + +import Foundation + +public struct WithdrawRequestDTO: Encodable { + public let agreedTermsIds: [String] + + public init(agreedTermsIds: [String]) { + self.agreedTermsIds = agreedTermsIds + } +} diff --git a/FLINT/Data/Sources/DTO/Base/BaseResponse.swift b/FLINT/Data/Sources/DTO/Base/BaseResponse.swift index cd097c8a..3a1832df 100644 --- a/FLINT/Data/Sources/DTO/Base/BaseResponse.swift +++ b/FLINT/Data/Sources/DTO/Base/BaseResponse.swift @@ -19,7 +19,7 @@ public struct BaseResponse: Codable { public let additionalInfo: [String: String]? public let status: Int - public let message: String + public let message: String? public let data: T? } @@ -36,7 +36,7 @@ extension BaseResponse { errorCode: errorCode ?? "", additionalInfo: additionalInfo ?? [:], status: status, - message: message + message: message ?? "" ) } } diff --git a/FLINT/Data/Sources/Networking/API/AuthAPI.swift b/FLINT/Data/Sources/Networking/API/AuthAPI.swift index 1f28956c..9f38f3d9 100644 --- a/FLINT/Data/Sources/Networking/API/AuthAPI.swift +++ b/FLINT/Data/Sources/Networking/API/AuthAPI.swift @@ -12,12 +12,12 @@ import Moya import DTO public enum AuthAPI { - case logout + case logout(refreshToken: String) case logoutAll case refresh case signup(userInfo: SignupRequestDTO) case socialVerify(socialAuthCredential: SocialVerifyRequestDTO) - case withdraw + case withdraw(agreedTermsIds: [String]) } extension AuthAPI: TargetType { @@ -25,7 +25,9 @@ extension AuthAPI: TargetType { switch self { case .signup: return "/api/v1/auth/signup" - case .logout, .logoutAll, .refresh: + case .logout: + return "/api/v1/auth/logout" + case .logoutAll, .refresh: #warning("TODO: - 나중에 구현할 것") return "TODO" case .socialVerify: @@ -50,8 +52,12 @@ extension AuthAPI: TargetType { return .requestJSONEncodable(userInfo) case let .socialVerify(socialAuthCredential): return .requestJSONEncodable(socialAuthCredential) - case .logout, .logoutAll, .refresh, .withdraw: + case let .logout(refreshToken): + return .requestJSONEncodable(LogoutRequestDTO(refreshToken: refreshToken)) + case .logoutAll, .refresh: return .requestPlain + case let .withdraw(agreedTermsIds): + return .requestJSONEncodable(WithdrawRequestDTO(agreedTermsIds: agreedTermsIds)) } } } diff --git a/FLINT/Data/Sources/Networking/Service/AuthService.swift b/FLINT/Data/Sources/Networking/Service/AuthService.swift index be999c37..8f36f3a7 100644 --- a/FLINT/Data/Sources/Networking/Service/AuthService.swift +++ b/FLINT/Data/Sources/Networking/Service/AuthService.swift @@ -18,7 +18,8 @@ import DTO public protocol AuthService { func signup(userInfo: SignupInfoEntity) -> AnyPublisher func socialVerify(socialAuthCredential: SocialVerifyRequestDTO) -> AnyPublisher - func withDraw() -> AnyPublisher + func logout() -> AnyPublisher + func withDraw(agreedTermsIds: [String]) -> AnyPublisher } public final class DefaultAuthService: AuthService { @@ -67,8 +68,22 @@ public final class DefaultAuthService: AuthService { .eraseToAnyPublisher() } - public func withDraw() -> AnyPublisher { - authAPIProvider.requestPublisher(.withdraw) + public func logout() -> AnyPublisher { + guard let refreshToken = tokenStorage.load(type: .refreshToken) else { + return Fail(error: TokenError.noToken).eraseToAnyPublisher() + } + return authAPIProvider.requestPublisher(.logout(refreshToken: refreshToken)) + .logged() + .mapBaseResponseData(BlankData.self) + .map({ [weak self] _ in + self?.tokenStorage.clearAll() + }) + .eraseToAnyPublisher() + } + + public func withDraw(agreedTermsIds: [String]) -> AnyPublisher { + return authAPIProvider.requestPublisher(.withdraw(agreedTermsIds: agreedTermsIds)) + .logged() .mapBaseResponseData(BlankData.self) .map({ _ in }) .eraseToAnyPublisher() diff --git a/FLINT/Data/Sources/RepositoryImpl/AuthRepositoryImpl.swift b/FLINT/Data/Sources/RepositoryImpl/AuthRepositoryImpl.swift index c7647ec8..b61f3863 100644 --- a/FLINT/Data/Sources/RepositoryImpl/AuthRepositoryImpl.swift +++ b/FLINT/Data/Sources/RepositoryImpl/AuthRepositoryImpl.swift @@ -33,7 +33,11 @@ public final class DefaultAuthRepository: AuthRepository { .eraseToAnyPublisher() } - public func withDraw() -> AnyPublisher { - return authService.withDraw() + public func logout() -> AnyPublisher { + return authService.logout() + } + + public func withDraw(agreedTermsIds: [String]) -> AnyPublisher { + return authService.withDraw(agreedTermsIds: agreedTermsIds) } } diff --git a/FLINT/Domain/Sources/Repository/AuthRepository.swift b/FLINT/Domain/Sources/Repository/AuthRepository.swift index 7ab15d08..52ccf0a6 100644 --- a/FLINT/Domain/Sources/Repository/AuthRepository.swift +++ b/FLINT/Domain/Sources/Repository/AuthRepository.swift @@ -13,5 +13,6 @@ import Entity public protocol AuthRepository { func signup(userInfo: SignupInfoEntity) -> AnyPublisher func socialVerify(socialAuthCredential: SocialVerifyEntity) -> AnyPublisher - func withDraw() -> AnyPublisher + func logout() -> AnyPublisher + func withDraw(agreedTermsIds: [String]) -> AnyPublisher } diff --git a/FLINT/Domain/Sources/UseCase/Auth/LogoutUseCase.swift b/FLINT/Domain/Sources/UseCase/Auth/LogoutUseCase.swift new file mode 100644 index 00000000..6880c3d7 --- /dev/null +++ b/FLINT/Domain/Sources/UseCase/Auth/LogoutUseCase.swift @@ -0,0 +1,28 @@ +// +// LogoutUseCase.swift +// Domain +// +// Created by 소은 on 6/19/26. +// + +import Combine +import Foundation + +import Repository + +public protocol LogoutUseCase { + func callAsFunction() -> AnyPublisher +} + +public final class DefaultLogoutUseCase: LogoutUseCase { + + private let authRepository: AuthRepository + + public init(authRepository: AuthRepository) { + self.authRepository = authRepository + } + + public func callAsFunction() -> AnyPublisher { + return authRepository.logout() + } +} diff --git a/FLINT/Domain/Sources/UseCase/Auth/WithDrawUseCase.swift b/FLINT/Domain/Sources/UseCase/Auth/WithDrawUseCase.swift index afe2fdec..0c27fc9f 100644 --- a/FLINT/Domain/Sources/UseCase/Auth/WithDrawUseCase.swift +++ b/FLINT/Domain/Sources/UseCase/Auth/WithDrawUseCase.swift @@ -12,7 +12,7 @@ import Entity import Repository public protocol WithDrawUseCase { - func callAsFunction() -> AnyPublisher + func callAsFunction(agreedTermsIds: [String]) -> AnyPublisher } public final class DefaultWithDrawUseCase: WithDrawUseCase { @@ -23,7 +23,7 @@ public final class DefaultWithDrawUseCase: WithDrawUseCase { self.authRepository = authRepository } - public func callAsFunction() -> AnyPublisher { - return authRepository.withDraw() + public func callAsFunction(agreedTermsIds: [String]) -> AnyPublisher { + return authRepository.withDraw(agreedTermsIds: agreedTermsIds) } } diff --git a/FLINT/FLINT/Dependency/DIContainer.swift b/FLINT/FLINT/Dependency/DIContainer.swift index 4c842490..30beb40b 100644 --- a/FLINT/FLINT/Dependency/DIContainer.swift +++ b/FLINT/FLINT/Dependency/DIContainer.swift @@ -24,6 +24,9 @@ typealias DependencyFactory = ViewControllerFactory & ExploreViewModelFactory & ProfileViewModelFactory & + SettingViewModelFactory & + WithdrawViewModelFactory & + CreateCollectionViewModelFactory & AddContentSelectViewModelFactory & CollectionFolderListViewModelFactory & diff --git a/FLINT/FLINT/Dependency/Factory/UseCase/Auth/LogoutUseCaseFactory..swift b/FLINT/FLINT/Dependency/Factory/UseCase/Auth/LogoutUseCaseFactory..swift new file mode 100644 index 00000000..4c094e68 --- /dev/null +++ b/FLINT/FLINT/Dependency/Factory/UseCase/Auth/LogoutUseCaseFactory..swift @@ -0,0 +1,20 @@ +// +// LogoutUseCaseFactory..swift +// FLINT +// +// Created by 소은 on 6/19/26. +// + +import Foundation + +import Domain + +protocol LogoutUseCaseFactory: AuthRepositoryFactory { + func makeLogoutUseCase() -> LogoutUseCase +} + +extension LogoutUseCaseFactory { + func makeLogoutUseCase() -> LogoutUseCase { + return DefaultLogoutUseCase(authRepository: makeAuthRepository()) + } +} diff --git a/FLINT/FLINT/Dependency/Factory/ViewController/SettingViewControllerFactory+.swift b/FLINT/FLINT/Dependency/Factory/ViewController/SettingViewControllerFactory+.swift new file mode 100644 index 00000000..a45bd3df --- /dev/null +++ b/FLINT/FLINT/Dependency/Factory/ViewController/SettingViewControllerFactory+.swift @@ -0,0 +1,19 @@ +// +// SettingViewControllerFactory+.swift +// FLINT +// +// Created by 소은 on 6/19/26. +// + +import Foundation + +import Presentation + +extension SettingViewControllerFactory where Self: SettingViewModelFactory & ViewControllerFactory { + func makeSettingViewController() -> SettingViewController { + return SettingViewController( + settingViewModel: makeSettingViewModel(), + viewControllerFactory: self + ) + } +} diff --git a/FLINT/FLINT/Dependency/Factory/ViewController/WithdrawalViewControllerFactory+.swift b/FLINT/FLINT/Dependency/Factory/ViewController/WithdrawalViewControllerFactory+.swift new file mode 100644 index 00000000..0134366a --- /dev/null +++ b/FLINT/FLINT/Dependency/Factory/ViewController/WithdrawalViewControllerFactory+.swift @@ -0,0 +1,19 @@ +// +// WithdrawalViewControllerFactory+.swift +// FLINT +// +// Created by 소은 on 6/19/26. +// + +import Foundation + +import Presentation + +extension WithdrawalViewControllerFactory where Self: WithdrawViewModelFactory & ViewControllerFactory { + func makeWithdrawalViewController() -> WithdrawalViewController { + return WithdrawalViewController( + viewModel: makeWithdrawViewModel(), + viewControllerFactory: self + ) + } +} diff --git a/FLINT/FLINT/Dependency/Factory/ViewModel/SettingViewModelFactory.swift b/FLINT/FLINT/Dependency/Factory/ViewModel/SettingViewModelFactory.swift new file mode 100644 index 00000000..4c952200 --- /dev/null +++ b/FLINT/FLINT/Dependency/Factory/ViewModel/SettingViewModelFactory.swift @@ -0,0 +1,20 @@ +// +// SettingViewModelFactory.swift +// FLINT +// +// Created by 소은 on 6/19/26. +// + +import Foundation + +import Presentation + +protocol SettingViewModelFactory: LogoutUseCaseFactory { + func makeSettingViewModel() -> any SettingViewModel +} + +extension SettingViewModelFactory { + func makeSettingViewModel() -> any SettingViewModel { + return DefaultSettingViewModel(logoutUseCase: makeLogoutUseCase()) + } +} diff --git a/FLINT/FLINT/Dependency/Factory/ViewModel/WithdrawViewModelFactory.swift b/FLINT/FLINT/Dependency/Factory/ViewModel/WithdrawViewModelFactory.swift new file mode 100644 index 00000000..263b066b --- /dev/null +++ b/FLINT/FLINT/Dependency/Factory/ViewModel/WithdrawViewModelFactory.swift @@ -0,0 +1,19 @@ +// +// WithdrawViewModelFactory.swift +// FLINT +// +// Created by 소은 on 6/19/26. +// + +import Foundation +import Presentation + +protocol WithdrawViewModelFactory: WithDrawUseCaseFactory { + func makeWithdrawViewModel() -> WithdrawViewModel +} + +extension WithdrawViewModelFactory { + func makeWithdrawViewModel() -> WithdrawViewModel { + return WithdrawViewModel(withDrawUseCase: makeWithDrawUseCase()) + } +} diff --git a/FLINT/Presentation/Sources/ViewController/Dependency/ViewControllerFactory.swift b/FLINT/Presentation/Sources/ViewController/Dependency/ViewControllerFactory.swift index 7b5b09ac..67814ccc 100644 --- a/FLINT/Presentation/Sources/ViewController/Dependency/ViewControllerFactory.swift +++ b/FLINT/Presentation/Sources/ViewController/Dependency/ViewControllerFactory.swift @@ -35,4 +35,6 @@ public typealias ViewControllerFactory = CollectionFolderListViewControllerFactory & CollectionDetailViewControllerFactory & AddContentSelectViewControllerFactory & - CreateCollectionViewControllerFactory + CreateCollectionViewControllerFactory & + SettingViewControllerFactory & + WithdrawalViewControllerFactory diff --git a/FLINT/Presentation/Sources/ViewController/Scene/Setting/SettingViewController.swift b/FLINT/Presentation/Sources/ViewController/Scene/Setting/SettingViewController.swift index d189c45c..527ee355 100644 --- a/FLINT/Presentation/Sources/ViewController/Scene/Setting/SettingViewController.swift +++ b/FLINT/Presentation/Sources/ViewController/Scene/Setting/SettingViewController.swift @@ -314,7 +314,8 @@ private extension SettingViewController { } func showWithdrawalAlert() { - print("Navigate to Withdrawal Page") + guard let vc = viewControllerFactory?.makeWithdrawalViewController() else { return } + navigationController?.pushViewController(vc, animated: true) } func handleLogoutSuccess() { diff --git a/FLINT/Presentation/Sources/ViewController/WithdrawViewController.swift b/FLINT/Presentation/Sources/ViewController/WithdrawViewController.swift index 6b1b2c62..58f1f2ad 100644 --- a/FLINT/Presentation/Sources/ViewController/WithdrawViewController.swift +++ b/FLINT/Presentation/Sources/ViewController/WithdrawViewController.swift @@ -12,6 +12,10 @@ import Combine import View import ViewModel +public protocol WithdrawalViewControllerFactory { + func makeWithdrawalViewController() -> WithdrawalViewController +} + public final class WithdrawalViewController: BaseViewController { // MARK: - Property @@ -23,10 +27,9 @@ public final class WithdrawalViewController: BaseViewController // MARK: - Init - public init(viewModel: WithdrawViewModel) { + public init(viewModel: WithdrawViewModel, viewControllerFactory: (any ViewControllerFactory)?) { self.viewModel = viewModel - // FIXME: viewControllerFactory 주입해주기 - super.init(viewControllerFactory: nil) + super.init(viewControllerFactory: viewControllerFactory) } required init?(coder: NSCoder) { @@ -65,8 +68,15 @@ public final class WithdrawalViewController: BaseViewController output.withdrawSuccess .receive(on: DispatchQueue.main) .sink { [weak self] _ in - print("탈퇴 성공") - self?.navigationController?.popViewController(animated: true) + guard let self else { return } + guard let loginVC = viewControllerFactory?.makeLoginViewController() else { return } + let nav = UINavigationController(rootViewController: loginVC) + nav.modalPresentationStyle = .fullScreen + if let window = view.window { + UIView.transition(with: window, duration: 0.3, options: .transitionCrossDissolve) { + window.rootViewController = nav + } + } } .store(in: &cancellables) @@ -78,7 +88,7 @@ public final class WithdrawalViewController: BaseViewController .store(in: &cancellables) } - // MARK: - Setup + // MARK: - Setup private func setupNavigationBar() { setNavigationBar(.init( diff --git a/FLINT/Presentation/Sources/ViewModel/Scene/Setting/SettingViewModel.swift b/FLINT/Presentation/Sources/ViewModel/Scene/Setting/SettingViewModel.swift index 6ce10397..c813e5e9 100644 --- a/FLINT/Presentation/Sources/ViewModel/Scene/Setting/SettingViewModel.swift +++ b/FLINT/Presentation/Sources/ViewModel/Scene/Setting/SettingViewModel.swift @@ -55,12 +55,13 @@ public final class DefaultSettingViewModel: SettingViewModel { // MARK: - Properties + private let logoutUseCase: LogoutUseCase private var cancellables: Set = Set() // MARK: - Initialization - public init() { - // TODO: UseCase 주입 + public init(logoutUseCase: LogoutUseCase) { + self.logoutUseCase = logoutUseCase fetchUserProfile() } @@ -91,8 +92,19 @@ public final class DefaultSettingViewModel: SettingViewModel { } public func performLogout() { - // TODO: UseCase 연결 - logoutSuccess.send() + logoutUseCase() + .receive(on: DispatchQueue.main) + .sink( + receiveCompletion: { completion in + if case .failure(let error) = completion { + print("로그아웃 실패: \(error)") + } + }, + receiveValue: { [weak self] in + self?.logoutSuccess.send() + } + ) + .store(in: &cancellables) } public func performWithdrawal() { @@ -103,12 +115,11 @@ public final class DefaultSettingViewModel: SettingViewModel { // MARK: - Private Methods private func fetchUserProfile() { - // 임시 Mock 데이터 let mockProfile = UserProfileEntity( id: "user123", nickname: "플리니", profileImageUrl: nil, - role: .fliner + role: .fliner ) userProfile.send(mockProfile) } diff --git a/FLINT/Presentation/Sources/ViewModel/WithdrawViewModel.swift b/FLINT/Presentation/Sources/ViewModel/WithdrawViewModel.swift index 2941606b..689d5b98 100644 --- a/FLINT/Presentation/Sources/ViewModel/WithdrawViewModel.swift +++ b/FLINT/Presentation/Sources/ViewModel/WithdrawViewModel.swift @@ -5,19 +5,23 @@ // Created by 소은 on 5/13/26. // - import Foundation import Combine +import Domain + public final class WithdrawViewModel { - + // MARK: - Property - + + private let withDrawUseCase: WithDrawUseCase private var cancellables = Set() - + // MARK: - Init - - public init() {} + + public init(withDrawUseCase: WithDrawUseCase) { + self.withDrawUseCase = withDrawUseCase + } // MARK: - Input @@ -85,10 +89,9 @@ public final class WithdrawViewModel { // MARK: - Custom Method private func withdraw() -> AnyPublisher, Never> { - // TODO: UseCase 호출 - - // 임시 구현 - return Just(Result.success(())) + return withDrawUseCase(agreedTermsIds: ["10"]) + .map { Result.success($0) } + .catch { Just(Result.failure($0)) } .eraseToAnyPublisher() } } From ba1d130fade02e7dd3ce815ddde91020fb2ec843 Mon Sep 17 00:00:00 2001 From: soonny <134983918+soeun11@users.noreply.github.com> Date: Fri, 19 Jun 2026 23:53:34 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[chore]=20TODO=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/ViewModel/Scene/Setting/SettingViewModel.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/FLINT/Presentation/Sources/ViewModel/Scene/Setting/SettingViewModel.swift b/FLINT/Presentation/Sources/ViewModel/Scene/Setting/SettingViewModel.swift index c813e5e9..87b7cda2 100644 --- a/FLINT/Presentation/Sources/ViewModel/Scene/Setting/SettingViewModel.swift +++ b/FLINT/Presentation/Sources/ViewModel/Scene/Setting/SettingViewModel.swift @@ -108,7 +108,6 @@ public final class DefaultSettingViewModel: SettingViewModel { } public func performWithdrawal() { - // TODO: 탈퇴 UseCase 연결 print("회원탈퇴") } From d40e83a7d857f8d051b3e3d88d0ec50e31f7d547 Mon Sep 17 00:00:00 2001 From: soonny <134983918+soeun11@users.noreply.github.com> Date: Sat, 27 Jun 2026 22:07:51 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[feat]=20=EC=84=B8=ED=8C=85=20=EB=B7=B0=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FLINT/FLINT/Dependency/DIContainer.swift | 6 +----- .../ViewController/Scene/Home/HomeViewController.swift | 2 +- .../Scene/Profile/ProfileViewController.swift | 5 +++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/FLINT/FLINT/Dependency/DIContainer.swift b/FLINT/FLINT/Dependency/DIContainer.swift index 57c9e6cb..23ecd96c 100644 --- a/FLINT/FLINT/Dependency/DIContainer.swift +++ b/FLINT/FLINT/Dependency/DIContainer.swift @@ -24,13 +24,9 @@ typealias DependencyFactory = ViewControllerFactory & FetchOTTPlatformsForContentUseCaseFactory & ExploreViewModelFactory & ProfileViewModelFactory & - -<<<<<<< HEAD - ReportViewModelFactory & -======= + SettingViewModelFactory & WithdrawViewModelFactory & ->>>>>>> network/#201-setting-api CreateCollectionViewModelFactory & AddContentSelectViewModelFactory & diff --git a/FLINT/Presentation/Sources/ViewController/Scene/Home/HomeViewController.swift b/FLINT/Presentation/Sources/ViewController/Scene/Home/HomeViewController.swift index ce15e83e..01ab5b8b 100644 --- a/FLINT/Presentation/Sources/ViewController/Scene/Home/HomeViewController.swift +++ b/FLINT/Presentation/Sources/ViewController/Scene/Home/HomeViewController.swift @@ -32,7 +32,7 @@ public final class HomeViewController: BaseViewController { ) { self.viewModel = viewModel self.fetchOTTPlatformsForContentUseCase = fetchOTTPlatformsForContentUseCase - super.init(nibName: nil, bundle: nil) + super.init(viewControllerFactory: viewControllerFactory) self.viewControllerFactory = viewControllerFactory } diff --git a/FLINT/Presentation/Sources/ViewController/Scene/Profile/ProfileViewController.swift b/FLINT/Presentation/Sources/ViewController/Scene/Profile/ProfileViewController.swift index 09ef485a..ae04cfe9 100644 --- a/FLINT/Presentation/Sources/ViewController/Scene/Profile/ProfileViewController.swift +++ b/FLINT/Presentation/Sources/ViewController/Scene/Profile/ProfileViewController.swift @@ -62,8 +62,9 @@ public final class ProfileViewController: BaseViewController { } private func didTapSetting() { - // TODO: SettingViewController push (DI에 SettingViewControllerFactory 등록 후 연결) - print("setting tapped") + guard let factory = viewControllerFactory else { return } + let settingVC = factory.makeSettingViewController() + navigationController?.pushViewController(settingVC, animated: true) } private func setupTableView() { From 2fb0fd2be436b9cd8bd03586e7695b8e7adfca5c Mon Sep 17 00:00:00 2001 From: soonny <134983918+soeun11@users.noreply.github.com> Date: Sat, 27 Jun 2026 22:12:35 +0900 Subject: [PATCH 4/6] =?UTF-8?q?[feat]=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EA=B8=B0=EB=8A=A5=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Networking/Service/AuthService.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/FLINT/Data/Sources/Networking/Service/AuthService.swift b/FLINT/Data/Sources/Networking/Service/AuthService.swift index 8f36f3a7..ce41afe2 100644 --- a/FLINT/Data/Sources/Networking/Service/AuthService.swift +++ b/FLINT/Data/Sources/Networking/Service/AuthService.swift @@ -74,18 +74,18 @@ public final class DefaultAuthService: AuthService { } return authAPIProvider.requestPublisher(.logout(refreshToken: refreshToken)) .logged() - .mapBaseResponseData(BlankData.self) - .map({ [weak self] _ in + .tryMap { [weak self] response in + guard (200..<300).contains(response.statusCode) else { + throw MoyaError.statusCode(response) + } self?.tokenStorage.clearAll() - }) + } .eraseToAnyPublisher() } public func withDraw(agreedTermsIds: [String]) -> AnyPublisher { return authAPIProvider.requestPublisher(.withdraw(agreedTermsIds: agreedTermsIds)) .logged() - .mapBaseResponseData(BlankData.self) - .map({ _ in }) - .eraseToAnyPublisher() + .mapBaseResponseEmpty() } } From 20dde1b51d3b6f93fc5c99be7130e83f47f4bb41 Mon Sep 17 00:00:00 2001 From: soonny <134983918+soeun11@users.noreply.github.com> Date: Sat, 27 Jun 2026 22:40:00 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[fix]=20ott=20list=20=EC=95=88=EB=9C=A8?= =?UTF-8?q?=EB=8A=94=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewController/Scene/Home/HomeViewController.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/FLINT/Presentation/Sources/ViewController/Scene/Home/HomeViewController.swift b/FLINT/Presentation/Sources/ViewController/Scene/Home/HomeViewController.swift index 01ab5b8b..915d7bb9 100644 --- a/FLINT/Presentation/Sources/ViewController/Scene/Home/HomeViewController.swift +++ b/FLINT/Presentation/Sources/ViewController/Scene/Home/HomeViewController.swift @@ -109,7 +109,7 @@ public final class HomeViewController: BaseViewController { title: "이 작품을 볼 수 있는 OTT", content: .ott(platforms: platforms) ) - present(vc, animated: false) + present(vc, animated: true) } private func fetchAndPresentOTT(contentId: Int64) { @@ -246,9 +246,10 @@ extension HomeViewController: UITableViewDataSource { cell.onTapItem = { [weak self] content in guard let self else { return } - guard let contentId = Int64(content.id) else { return } - - self.fetchAndPresentOTT(contentId: contentId) + let platforms: [OTTPlatform] = content.ottList.compactMap { ott in + OTTPlatform.fromServerName(ott.ottName) + } + self.presentOTTBottomSheet(platforms: platforms) } return cell From a36e7e61dc52fb7664138c02cd92886ab831b0a4 Mon Sep 17 00:00:00 2001 From: soonny <134983918+soeun11@users.noreply.github.com> Date: Fri, 3 Jul 2026 22:49:40 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[fix]=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EB=B9=84=EC=9C=A8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SelectedContentReasonTableViewCell.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FLINT/Presentation/Sources/View/Component/SelectedContentReasonTableViewCell/SelectedContentReasonTableViewCell.swift b/FLINT/Presentation/Sources/View/Component/SelectedContentReasonTableViewCell/SelectedContentReasonTableViewCell.swift index 766baf37..684d1d58 100644 --- a/FLINT/Presentation/Sources/View/Component/SelectedContentReasonTableViewCell/SelectedContentReasonTableViewCell.swift +++ b/FLINT/Presentation/Sources/View/Component/SelectedContentReasonTableViewCell/SelectedContentReasonTableViewCell.swift @@ -337,10 +337,12 @@ public final class SelectedContentReasonTableViewCell: BaseTableViewCell { } private func makePhotoWrapper(image: UIImage, realIndex: Int) -> UIView { - let wrapper = UIView().then { $0.clipsToBounds = true } - + let wrapper = UIView().then { + $0.clipsToBounds = true + $0.backgroundColor = .flintGray800 + } let imageView = UIImageView().then { - $0.contentMode = .scaleAspectFill + $0.contentMode = .scaleAspectFit $0.clipsToBounds = true $0.image = image }