diff --git a/SOPT-iOS/Projects/Core/Sources/Extension/Foundation+/Date+.swift b/SOPT-iOS/Projects/Core/Sources/Extension/Foundation+/Date+.swift index f11826859..ff205aa97 100644 --- a/SOPT-iOS/Projects/Core/Sources/Extension/Foundation+/Date+.swift +++ b/SOPT-iOS/Projects/Core/Sources/Extension/Foundation+/Date+.swift @@ -23,6 +23,8 @@ public extension Date { dateComponents.year = year dateComponents.month = month dateComponents.day = day - return calendar.date(from: dateComponents) ?? nil + + let usaDate = calendar.date(from: dateComponents) + return usaDate!.addingTimeInterval(9 * 60 * 60) } } diff --git a/SOPT-iOS/Projects/Data/Sources/Repository/AppMyPageRepository.swift b/SOPT-iOS/Projects/Data/Sources/Repository/AppMyPageRepository.swift index 03e7f3c34..828d0e8e7 100644 --- a/SOPT-iOS/Projects/Data/Sources/Repository/AppMyPageRepository.swift +++ b/SOPT-iOS/Projects/Data/Sources/Repository/AppMyPageRepository.swift @@ -33,20 +33,6 @@ extension AppMyPageRepository: AppMyPageRepositoryInterface { .asDriver() } - public func getNotificationIsAllowed() -> Driver { - self.userService - .getNotificationIsAllowed() - .map(\.isOptIn) - .asDriver() - } - - public func optInPushNotificationInGeneral(to isOn: Bool) -> Driver { - self.userService - .optInPushNotificationInGeneral(to: isOn) - .map(\.isOptIn) - .asDriver() - } - public func deregisterPushToken(with token: String) -> AnyPublisher { self.userService.deregisterPushToken(with: token) .map { diff --git a/SOPT-iOS/Projects/Data/Sources/Repository/MainRepository.swift b/SOPT-iOS/Projects/Data/Sources/Repository/MainRepository.swift index 1141d6b6a..5ab97fabc 100644 --- a/SOPT-iOS/Projects/Data/Sources/Repository/MainRepository.swift +++ b/SOPT-iOS/Projects/Data/Sources/Repository/MainRepository.swift @@ -15,21 +15,18 @@ import Networks public class MainRepository { private let userService: UserService - private let configService: ConfigService private let descriptionService: DescriptionService private let pokeService: PokeService private let stampService: StampService private let cancelBag = CancelBag() - public init(userService: UserService, - configService: ConfigService, + public init(userService: UserService, descriptionService: DescriptionService, pokeService: PokeService, stampService: StampService ) { self.userService = userService - self.configService = configService self.descriptionService = descriptionService self.pokeService = pokeService self.stampService = stampService @@ -60,16 +57,6 @@ extension MainRepository: MainRepositoryInterface { .eraseToAnyPublisher() } - public func getServiceState() -> AnyPublisher { - configService.getServiceAvailability() - .mapError { error in - print(error) - return MainError.networkError(message: "GetServiceState 에러") - } - .map { $0.toDomain() } - .eraseToAnyPublisher() - } - public func getMainViewDescription() -> AnyPublisher { descriptionService.getMainViewDescription() .mapError { error in diff --git a/SOPT-iOS/Projects/Data/Sources/Repository/SettingRepository.swift b/SOPT-iOS/Projects/Data/Sources/Repository/SettingRepository.swift index 0973da187..145463d72 100644 --- a/SOPT-iOS/Projects/Data/Sources/Repository/SettingRepository.swift +++ b/SOPT-iOS/Projects/Data/Sources/Repository/SettingRepository.swift @@ -44,17 +44,6 @@ extension SettingRepository: SettingRepositoryInterface { .eraseToAnyPublisher() } - public func editNickname(nickname: String) -> AnyPublisher { - return userService.changeNickname(nickname: nickname) - .map { _ in true } - .replaceError(with: false) - .handleEvents(receiveOutput: { isSuccessed in - guard isSuccessed else { return } - UserDefaultKeyList.User.soptampName = nickname - }) - .eraseToAnyPublisher() - } - public func withdrawal() -> AnyPublisher { return userService.withdraw() .handleEvents(receiveOutput: { status in diff --git a/SOPT-iOS/Projects/Data/Sources/Repository/SignUpRepository.swift b/SOPT-iOS/Projects/Data/Sources/Repository/SignUpRepository.swift deleted file mode 100644 index 3963d1986..000000000 --- a/SOPT-iOS/Projects/Data/Sources/Repository/SignUpRepository.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// SignUpRepository.swift -// Data -// -// Created by sejin on 2022/11/28. -// Copyright © 2022 SOPT-Stamp-iOS. All rights reserved. -// - -import Combine - -import Core -import Domain -import Networks - -public class SignUpRepository { - - private let networkService: UserService - private let cancelBag = CancelBag() - - public init(service: UserService) { - self.networkService = service - } -} - -extension SignUpRepository: SignUpRepositoryInterface { - public func getNicknameAvailable(nickname: String) -> AnyPublisher { - return networkService.getNicknameAvailable(nickname: nickname).map { statusCode in - statusCode == 200 - }.eraseToAnyPublisher() - } -} diff --git a/SOPT-iOS/Projects/Data/Sources/Transform/MainTransform.swift b/SOPT-iOS/Projects/Data/Sources/Transform/MainTransform.swift index 545b009e5..392365e89 100644 --- a/SOPT-iOS/Projects/Data/Sources/Transform/MainTransform.swift +++ b/SOPT-iOS/Projects/Data/Sources/Transform/MainTransform.swift @@ -17,9 +17,3 @@ extension MainEntity { return UserMainInfoModel.init(status: user.status, name: user.name, profileImage: user.profileImage, historyList: user.historyList, attendanceScore: operation?.attendanceScore, announcement: operation?.announcement, isAllConfirm: isAllConfirm) } } - -extension ServiceStateEntity { - public func toDomain() -> ServiceStateModel { - return ServiceStateModel(isAvailable: isAvailable) - } -} diff --git a/SOPT-iOS/Projects/Demo/Sources/Dependency/RegisterDependencies.swift b/SOPT-iOS/Projects/Demo/Sources/Dependency/RegisterDependencies.swift index 4ee0632d3..df3fb848b 100644 --- a/SOPT-iOS/Projects/Demo/Sources/Dependency/RegisterDependencies.swift +++ b/SOPT-iOS/Projects/Demo/Sources/Dependency/RegisterDependencies.swift @@ -38,7 +38,6 @@ extension AppDelegate { implement: { MainRepository( userService: DefaultUserService(), - configService: DefaultConfigService(), descriptionService: DefaultDescriptionService(), pokeService: DefaultPokeService(), stampService: DefaultStampService() @@ -80,14 +79,6 @@ extension AppDelegate { ) } ) - container.register( - interface: SignUpRepositoryInterface.self, - implement: { - SignUpRepository( - service: DefaultUserService() - ) - } - ) container.register( interface: MissionListRepositoryInterface.self, implement: { diff --git a/SOPT-iOS/Projects/Domain/Sources/Model/ServiceStateModel.swift b/SOPT-iOS/Projects/Domain/Sources/Model/ServiceStateModel.swift deleted file mode 100644 index 2444f6d28..000000000 --- a/SOPT-iOS/Projects/Domain/Sources/Model/ServiceStateModel.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// ServiceStateModel.swift -// Domain -// -// Created by sejin on 2023/04/15. -// Copyright © 2023 SOPT-iOS. All rights reserved. -// - -import Foundation - -public struct ServiceStateModel: Equatable { - public let isAvailable: Bool - - public init(isAvailable: Bool) { - self.isAvailable = isAvailable - } -} diff --git a/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/AppMyPageRepositoryInterface.swift b/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/AppMyPageRepositoryInterface.swift index 9b74e337e..80ce92337 100644 --- a/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/AppMyPageRepositoryInterface.swift +++ b/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/AppMyPageRepositoryInterface.swift @@ -12,7 +12,5 @@ import Core public protocol AppMyPageRepositoryInterface { func resetStamp() -> Driver - func getNotificationIsAllowed() -> Driver - func optInPushNotificationInGeneral(to isOn: Bool) -> Driver func deregisterPushToken(with token: String) -> AnyPublisher } diff --git a/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/MainRepositoryInterface.swift b/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/MainRepositoryInterface.swift index 2a80f8416..c177deb4e 100644 --- a/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/MainRepositoryInterface.swift +++ b/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/MainRepositoryInterface.swift @@ -12,7 +12,6 @@ import Combine public protocol MainRepositoryInterface { func getUserMainInfo() -> AnyPublisher - func getServiceState() -> AnyPublisher func getMainViewDescription() -> AnyPublisher func registerPushToken(with token: String) -> AnyPublisher func checkPokeNewUser() -> AnyPublisher diff --git a/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/SettingRepositoryInterface.swift b/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/SettingRepositoryInterface.swift index be91acd7b..2c59f5ae5 100644 --- a/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/SettingRepositoryInterface.swift +++ b/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/SettingRepositoryInterface.swift @@ -13,6 +13,5 @@ import Combine public protocol SettingRepositoryInterface { func resetStamp() -> Driver func editSentence(sentence: String) -> AnyPublisher - func editNickname(nickname: String) -> AnyPublisher func withdrawal() -> AnyPublisher } diff --git a/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/SignUpRepositoryInterface.swift b/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/SignUpRepositoryInterface.swift deleted file mode 100644 index 1fb37db30..000000000 --- a/SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/SignUpRepositoryInterface.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// SignUpRepositoryInterface.swift -// Domain -// -// Created by sejin on 2022/11/28. -// Copyright © 2022 SOPT-Stamp-iOS. All rights reserved. -// - -import Combine - -public protocol SignUpRepositoryInterface { - func getNicknameAvailable(nickname: String) -> AnyPublisher -} diff --git a/SOPT-iOS/Projects/Domain/Sources/UseCase/AppMyPageUseCase.swift b/SOPT-iOS/Projects/Domain/Sources/UseCase/AppMyPageUseCase.swift index 0c6ed7183..b6657d129 100644 --- a/SOPT-iOS/Projects/Domain/Sources/UseCase/AppMyPageUseCase.swift +++ b/SOPT-iOS/Projects/Domain/Sources/UseCase/AppMyPageUseCase.swift @@ -12,8 +12,6 @@ import Combine public protocol AppMyPageUseCase { func resetStamp() - func fetchUserNotificationIsAllowed() - func optInPushNotificationInGeneral(to isOn: Bool) func deregisterPushToken() var resetSuccess: PassthroughSubject { get } @@ -46,22 +44,6 @@ extension DefaultAppMyPageUseCase: AppMyPageUseCase { }.store(in: self.cancelBag) } - public func fetchUserNotificationIsAllowed() { - self.repository - .getNotificationIsAllowed() - .sink { isAllowed in - self.originUserNotificationIsAllowedStatus.send(isAllowed) - }.store(in: self.cancelBag) - } - - public func optInPushNotificationInGeneral(to isOn: Bool) { - self.repository - .optInPushNotificationInGeneral(to: isOn) - .sink { isOn in - self.optInPushNotificationResult.send(isOn) - }.store(in: self.cancelBag) - } - public func deregisterPushToken() { guard let pushToken = UserDefaultKeyList.User.pushToken, !pushToken.isEmpty else { return } diff --git a/SOPT-iOS/Projects/Domain/Sources/UseCase/MainUseCase.swift b/SOPT-iOS/Projects/Domain/Sources/UseCase/MainUseCase.swift index 13d39dde1..5adeb3a3f 100644 --- a/SOPT-iOS/Projects/Domain/Sources/UseCase/MainUseCase.swift +++ b/SOPT-iOS/Projects/Domain/Sources/UseCase/MainUseCase.swift @@ -12,7 +12,6 @@ import Combine public protocol MainUseCase { var userMainInfo: PassthroughSubject { get set } - var serviceState: PassthroughSubject { get set } var mainDescription: PassthroughSubject { get set } var mainErrorOccurred: PassthroughSubject { get set } var isPokeNewUser: PassthroughSubject { get set } @@ -20,7 +19,6 @@ public protocol MainUseCase { var hotBoard: PassthroughSubject { get set } func getUserMainInfo() - func getServiceState() func getMainViewDescription() func registerPushToken() func checkPokeNewUser() @@ -35,7 +33,6 @@ public class DefaultMainUseCase { private var cancelBag = CancelBag() public var userMainInfo = PassthroughSubject() - public var serviceState = PassthroughSubject() public var mainDescription = PassthroughSubject() public var mainErrorOccurred = PassthroughSubject() public var isPokeNewUser = PassthroughSubject() @@ -62,18 +59,6 @@ extension DefaultMainUseCase: MainUseCase { }.store(in: self.cancelBag) } - public func getServiceState() { - repository.getServiceState() - .sink { [weak self] event in - print("MainUseCase getServiceState: \(event)") - if case Subscribers.Completion.failure = event { - self?.mainErrorOccurred.send(.networkError(message: "GetServiceState 실패")) - } - } receiveValue: { [weak self] serviceStateModel in - self?.serviceState.send(serviceStateModel) - }.store(in: self.cancelBag) - } - public func getMainViewDescription() { repository.getMainViewDescription() .replaceError(with: .defaultDescription) diff --git a/SOPT-iOS/Projects/Domain/Sources/UseCase/SettingUseCase.swift b/SOPT-iOS/Projects/Domain/Sources/UseCase/SettingUseCase.swift index 37bf44803..33b9ae456 100644 --- a/SOPT-iOS/Projects/Domain/Sources/UseCase/SettingUseCase.swift +++ b/SOPT-iOS/Projects/Domain/Sources/UseCase/SettingUseCase.swift @@ -12,9 +12,7 @@ import Core public protocol SettingUseCase { func resetStamp() - func editNickname(nickname: String) func withdrawal() - var editNicknameSuccess: PassthroughSubject { get set } var resetSuccess: PassthroughSubject { get set } var withdrawalSuccess: PassthroughSubject { get set } } @@ -25,7 +23,6 @@ public class DefaultSettingUseCase { private var cancelBag = CancelBag() public var resetSuccess = PassthroughSubject() - public var editNicknameSuccess = PassthroughSubject() public var withdrawalSuccess = PassthroughSubject() public init(repository: SettingRepositoryInterface) { @@ -42,14 +39,6 @@ extension DefaultSettingUseCase: SettingUseCase { }.store(in: self.cancelBag) } - public func editNickname(nickname: String) { - self.repository.editNickname(nickname: nickname) - .withUnretained(self) - .sink { owner, editSuccessed in - owner.editNicknameSuccess.send(editSuccessed) - }.store(in: self.cancelBag) - } - public func resetStamp() { repository.resetStamp() .sink { success in diff --git a/SOPT-iOS/Projects/Domain/Sources/UseCase/SignUpUseCase.swift b/SOPT-iOS/Projects/Domain/Sources/UseCase/SignUpUseCase.swift deleted file mode 100644 index 8c64ca6e9..000000000 --- a/SOPT-iOS/Projects/Domain/Sources/UseCase/SignUpUseCase.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// SignUpUseCase.swift -// Domain -// -// Created by sejin on 2022/11/28. -// Copyright © 2022 SOPT-Stamp-iOS. All rights reserved. -// - -import Foundation -import Combine - -import Core - -public protocol SignUpUseCase { - func checkNickname(nickname: String) - - var isNicknameValid: CurrentValueSubject<(Bool, String), Error> { get set } -} - -public class DefaultSignUpUseCase { - - private let repository: SignUpRepositoryInterface - private var cancelBag = CancelBag() - - public var isNicknameValid = CurrentValueSubject<(Bool, String), Error>((false, "")) - - public init(repository: SignUpRepositoryInterface) { - self.repository = repository - } -} - -extension DefaultSignUpUseCase: SignUpUseCase { - - public func checkNickname(nickname: String) { - let nicknameRegEx = "[가-힣ㄱ-ㅣA-Za-z\\s]{1,10}" - let pred = NSPredicate(format: "SELF MATCHES %@", nicknameRegEx) - let isValidForRegex = pred.evaluate(with: nickname) - let isEmptyNickname = nickname.replacingOccurrences(of: " ", with: "").count == 0 - guard isValidForRegex && !isEmptyNickname else { - self.isNicknameValid.send((false, I18N.SignUp.nicknameTextFieldPlaceholder)) - return - } - - repository.getNicknameAvailable(nickname: nickname) - .sink { event in - print("SignUpUseCase nickname: \(event)") - } receiveValue: { isValid in - if isValid { - self.isNicknameValid.send((true, I18N.SignUp.validNickname)) - } else { - self.isNicknameValid.send((false, I18N.SignUp.duplicatedNickname)) - } - }.store(in: cancelBag) - } -} diff --git a/SOPT-iOS/Projects/Domain/Tests/Sources/Mock/MockRepository/MockMainRepository.swift b/SOPT-iOS/Projects/Domain/Tests/Sources/Mock/MockRepository/MockMainRepository.swift index 49d72fa15..ad8291a3d 100644 --- a/SOPT-iOS/Projects/Domain/Tests/Sources/Mock/MockRepository/MockMainRepository.swift +++ b/SOPT-iOS/Projects/Domain/Tests/Sources/Mock/MockRepository/MockMainRepository.swift @@ -15,7 +15,6 @@ import Domain final class MockMainRepository: MainRepositoryInterface { var userInfoModelResponse: Result! - var serviceStateModelResponse: Result! private(set) var cancelBag = CancelBag() @@ -33,19 +32,4 @@ final class MockMainRepository: MainRepositoryInterface { } .eraseToAnyPublisher() } - - func getServiceState() -> AnyPublisher { - return Future { [weak self] promise in - guard let self = self else { return } - switch self.serviceStateModelResponse { - case .success(let model): - promise(.success(model)) - case .failure(let error): - promise(.failure(error)) - case .none: - XCTFail("Should Set serviceStateModelResponse") - } - } - .eraseToAnyPublisher() - } } diff --git a/SOPT-iOS/Projects/Domain/Tests/Sources/UseCaseTests/MainUseCaseTests.swift b/SOPT-iOS/Projects/Domain/Tests/Sources/UseCaseTests/MainUseCaseTests.swift index 6f0ea034d..c016fad62 100644 --- a/SOPT-iOS/Projects/Domain/Tests/Sources/UseCaseTests/MainUseCaseTests.swift +++ b/SOPT-iOS/Projects/Domain/Tests/Sources/UseCaseTests/MainUseCaseTests.swift @@ -124,66 +124,6 @@ final class DefaultMainUseCaseTests: XCTestCase { // Then XCTAssertEqual(result, expectationError) } - - func test_getServiceState() { - // Given - let expectation = XCTestExpectation(description: "GetServiceState") - let isAvailable = true - let serviceStateModel = ServiceStateModel(isAvailable: isAvailable) - repository.serviceStateModelResponse = .success(serviceStateModel) - var result: ServiceStateModel! - - // When - useCase.serviceState - .sink { completion in - switch completion { - case .finished: - break - case .failure(let error): - XCTFail("Error: \(error)") - } - } receiveValue: { model in - result = model - expectation.fulfill() - }.store(in: repository.cancelBag) - - useCase.getServiceState() - - wait(for: [expectation], timeout: 0.5) - - // Then - XCTAssertEqual(result.isAvailable, isAvailable) - } - - func test_getServiceState_ErrorOccurred() { - // Given - let expectation = XCTestExpectation(description: "GetUserMainInfo") - let expectationError: MainError = .authFailed - repository.serviceStateModelResponse = .failure(expectationError) - var result: MainError! - - // When - useCase.mainErrorOccurred - .sink { completion in - switch completion { - case .finished: - break - case .failure(let error): - XCTFail("Error: \(error)") - } - } receiveValue: { errorModel in - result = errorModel - expectation.fulfill() - } - .store(in: repository.cancelBag) - - useCase.getServiceState() - - wait(for: [expectation], timeout: 0.5) - - // Then - XCTAssertEqual(result, .networkError(message: "GetServiceState 실패")) - } } extension DefaultMainUseCaseTests { diff --git a/SOPT-iOS/Projects/Features/AppMyPageFeature/Interface/Sources/MyPage/MyPageFeatureBuildable.swift b/SOPT-iOS/Projects/Features/AppMyPageFeature/Interface/Sources/MyPage/MyPageFeatureBuildable.swift index 670a2d495..b840b86fb 100644 --- a/SOPT-iOS/Projects/Features/AppMyPageFeature/Interface/Sources/MyPage/MyPageFeatureBuildable.swift +++ b/SOPT-iOS/Projects/Features/AppMyPageFeature/Interface/Sources/MyPage/MyPageFeatureBuildable.swift @@ -10,7 +10,6 @@ import Core public protocol MyPageFeatureBuildable { func makeAppMyPage(userType: UserType) -> MyPageViewControllable - func makeNicknameEditVC() -> NicknameEditViewControllable func makeSentenceEditVC() -> SentenceEditViewControllable func makePrivacyPolicyVC() -> PrivacyPolicyViewControllable func makeTermsOfServiceVC() -> TermsOfServiceViewControllable diff --git a/SOPT-iOS/Projects/Features/AppMyPageFeature/Interface/Sources/MyPage/MyPageFeatureControllables.swift b/SOPT-iOS/Projects/Features/AppMyPageFeature/Interface/Sources/MyPage/MyPageFeatureControllables.swift index 18b8dacfd..fd580f5cc 100644 --- a/SOPT-iOS/Projects/Features/AppMyPageFeature/Interface/Sources/MyPage/MyPageFeatureControllables.swift +++ b/SOPT-iOS/Projects/Features/AppMyPageFeature/Interface/Sources/MyPage/MyPageFeatureControllables.swift @@ -9,7 +9,6 @@ import Core import BaseFeatureDependency -public protocol NicknameEditViewControllable: ViewControllable { } public protocol SentenceEditViewControllable: ViewControllable { } public protocol PrivacyPolicyViewControllable: ViewControllable { } public protocol TermsOfServiceViewControllable: ViewControllable { } diff --git a/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/AppMypageScene/AppMyPageViewController.swift b/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/AppMypageScene/AppMyPageViewController.swift index fed8af9d8..8ee194d9e 100644 --- a/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/AppMypageScene/AppMyPageViewController.swift +++ b/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/AppMypageScene/AppMyPageViewController.swift @@ -43,7 +43,6 @@ public final class AppMyPageVC: UIViewController, MyPageViewControllable { public var onAlertButtonTap: ((String) -> Void)? // MARK: Combine - private let viewWillAppear = PassthroughSubject() private let resetButtonTapped = PassthroughSubject() private let logoutButtonTapped = PassthroughSubject() private let cancelBag = CancelBag() @@ -185,12 +184,6 @@ extension AppMyPageVC { self.bindViews() self.bindViewModels() } - - public override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - - self.viewWillAppear.send(()) - } } extension AppMyPageVC { @@ -304,7 +297,6 @@ extension AppMyPageVC { private func bindViewModels() { let input = AppMyPageViewModel.Input( - viewWillAppear: self.viewWillAppear.asDriver(), resetButtonTapped: self.resetButtonTapped.asDriver(), logoutButtonTapped: self.logoutButtonTapped.asDriver() ) diff --git a/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/AppMypageScene/ViewModel/AppMyPageViewModel.swift b/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/AppMypageScene/ViewModel/AppMyPageViewModel.swift index 6004d12f1..7284e9eaa 100644 --- a/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/AppMypageScene/ViewModel/AppMyPageViewModel.swift +++ b/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/AppMypageScene/ViewModel/AppMyPageViewModel.swift @@ -17,7 +17,6 @@ public final class AppMyPageViewModel: MyPageViewModelType { // MARK: - Inputs public struct Input { - let viewWillAppear: Driver let resetButtonTapped: Driver let logoutButtonTapped: Driver } @@ -44,12 +43,6 @@ extension AppMyPageViewModel { public func transform(from input: Input, cancelBag: CancelBag) -> Output { let output = Output() self.bindOutput(output: output, cancelBag: cancelBag) - - input.viewWillAppear - .withUnretained(self) - .sink { owner, _ in - owner.useCase.fetchUserNotificationIsAllowed() - }.store(in: cancelBag) input.resetButtonTapped .withUnretained(self) diff --git a/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/Coordinator/MyPageBuilder.swift b/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/Coordinator/MyPageBuilder.swift index 2bfe4cbe5..6afc2ec2c 100644 --- a/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/Coordinator/MyPageBuilder.swift +++ b/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/Coordinator/MyPageBuilder.swift @@ -14,23 +14,12 @@ public final class MyPageBuilder { @Injected public var appMyPageRepository: AppMyPageRepositoryInterface @Injected public var settingRepository: SettingRepositoryInterface - @Injected public var signUpRepository: SignUpRepositoryInterface @Injected public var notificationSettingsRepository: NotificationSettingRepositoryInterface public init() { } } extension MyPageBuilder: MyPageFeatureBuildable { - public func makeNicknameEditVC() -> NicknameEditViewControllable { - let settingUseCase = DefaultSettingUseCase(repository: settingRepository) - let signUpUseCase = DefaultSignUpUseCase(repository: signUpRepository) - - let viewModel = NicknameEditViewModel(nicknameUseCase: signUpUseCase, editPostUseCase: settingUseCase) - let nicknameEdit = NicknameEditVC() - nicknameEdit.viewModel = viewModel - return nicknameEdit - } - public func makeSentenceEditVC() -> SentenceEditViewControllable { let useCase = DefaultSentenceEditUseCase(repository: settingRepository) let viewModel = SentenceEditViewModel(useCase: useCase) diff --git a/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/SOPTampScene/VC/NicknameEditVC.swift b/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/SOPTampScene/VC/NicknameEditVC.swift deleted file mode 100644 index 7d1bbbf64..000000000 --- a/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/SOPTampScene/VC/NicknameEditVC.swift +++ /dev/null @@ -1,141 +0,0 @@ -// -// NicknameEditVC.swift -// Presentation -// -// Created by Junho Lee on 2023/01/02. -// Copyright © 2023 SOPT-Stamp-iOS. All rights reserved. -// - -import UIKit - -import Core -import DSKit - -import Combine -import SnapKit -import Then - -import BaseFeatureDependency - -public class NicknameEditVC: UIViewController, NicknameEditViewControllable { - - // MARK: - Properties - - public var viewModel: NicknameEditViewModel! - private var cancelBag = CancelBag() - - // MARK: - UI Components - - private lazy var navigationBar = OPNavigationBar( - self, - type: .oneLeftButton, - backgroundColor: DSKitAsset.Colors.black100.color - ) - .addMiddleLabel(title: I18N.Setting.NicknameEdit.nicknameEdit) - - private let nicknameTextFieldView = AppTextFieldView(type: .plain) - .setTitle(I18N.SignUp.nickname) - .setMaxLength(10) - .setPlaceholder(I18N.SignUp.nicknameTextFieldPlaceholder) - .setAlertLabelEnabled(I18N.SignUp.duplicatedNickname) - - private let editNicknameButton = AppCustomButton(title: I18N.Setting.NicknameEdit.nicknameEdit) - .setEnabled(false) - - // MARK: - View Life Cycle - - public override func viewDidLoad() { - super.viewDidLoad() - self.bindViewModels() - self.setUI() - self.setLayout() - self.hideKeyboard() - } -} - -// MARK: - Methods - -extension NicknameEditVC { - - private func bindViewModels() { - let nicknameTextChanged = nicknameTextFieldView - .textChanged - .compactMap { $0 } - .eraseToAnyPublisher() - .asDriver() - - let editNicknameButtonTapped = self.editNicknameButton - .publisher(for: .touchUpInside) - .compactMap { _ in self.nicknameTextFieldView.text } - .filter { !$0.isEmpty } - .asDriver() - - let input = NicknameEditViewModel.Input(nicknameTextChanged: nicknameTextChanged, - editButtonTapped: editNicknameButtonTapped) - let output = self.viewModel.transform(from: input, cancelBag: self.cancelBag) - - output.nicknameAlert - .dropFirst() - .map { $0.convertToTextFieldAlertType() } - .assign(to: nicknameTextFieldView.kf.alertType, - on: nicknameTextFieldView) - .store(in: cancelBag) - - output.$editButtonEnabled - .assign(to: self.editNicknameButton.kf.isEnabled, on: self.editNicknameButton) - .store(in: self.cancelBag) - - output.editNicknameSuccessed - .withUnretained(self) - .sink { owner, isSuccessed in - if isSuccessed { - owner.showToastAndPopView() - } else { - owner.showNetworkAlert() - } - }.store(in: self.cancelBag) - } - - private func showToastAndPopView() { - self.navigationController?.popViewController(animated: true) - let window = self.view.window! - Toast.show(message: I18N.Setting.NicknameEdit.nicknameEditSuccess, - view: window, - safeAreaBottomInset: self.safeAreaBottomInset()) - } - - public func showNetworkAlert() { - AlertUtils.presentNetworkAlertVC( - theme: .main, - animated: true - ) - } -} - -// MARK: - UI & Layout - -extension NicknameEditVC { - private func setUI() { - self.view.backgroundColor = DSKitAsset.Colors.black100.color - self.navigationController?.navigationBar.isHidden = true - } - - private func setLayout() { - self.view.addSubviews(navigationBar, nicknameTextFieldView, editNicknameButton) - - navigationBar.snp.makeConstraints { make in - make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) - } - - nicknameTextFieldView.snp.makeConstraints { make in - make.top.equalTo(navigationBar.snp.bottom).offset(12.adjustedH) - make.leading.trailing.equalToSuperview().inset(20.adjusted) - } - - editNicknameButton.snp.makeConstraints { make in - make.top.equalTo(nicknameTextFieldView.snp.bottom).offset(26.adjustedH) - make.leading.trailing.equalToSuperview().inset(20.adjusted) - make.height.equalTo(56.adjustedH) - } - } -} diff --git a/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/SOPTampScene/ViewModel/NicknameEditViewModel.swift b/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/SOPTampScene/ViewModel/NicknameEditViewModel.swift deleted file mode 100644 index 7b9082f5a..000000000 --- a/SOPT-iOS/Projects/Features/AppMyPageFeature/Sources/SOPTampScene/ViewModel/NicknameEditViewModel.swift +++ /dev/null @@ -1,90 +0,0 @@ -// -// NicknameEditViewModel.swift -// Presentation -// -// Created by Junho Lee on 2023/01/02. -// Copyright © 2023 SOPT-Stamp-iOS. All rights reserved. -// - -import Foundation -import Combine - -import Core -import Domain - -public class NicknameEditViewModel: ViewModelType { - - // MARK: - Properties - - private let nicknameCheckUseCase: SignUpUseCase - private let editPostUseCase: SettingUseCase - private var cancelBag = CancelBag() - - // MARK: - Inputs - - public struct Input { - let nicknameTextChanged: Driver - let editButtonTapped: Driver - } - - // MARK: - Outputs - - public class Output { - var nicknameAlert = PassthroughSubject() - @Published var editButtonEnabled = false - var editNicknameSuccessed = PassthroughSubject() - } - - // MARK: - init - - public init(nicknameUseCase: SignUpUseCase, editPostUseCase: SettingUseCase) { - self.nicknameCheckUseCase = nicknameUseCase - self.editPostUseCase = editPostUseCase - } -} - -extension NicknameEditViewModel { - public func transform(from input: Input, cancelBag: CancelBag) -> Output { - let output = Output() - self.bindOutput(output: output, cancelBag: cancelBag) - - input.nicknameTextChanged - .handleEvents(receiveOutput: { _ in - output.editButtonEnabled = false - }) - .debounce(for: 0.5, scheduler: RunLoop.main) - .withUnretained(self) - .sink { owner, nickname in - if nickname.isEmpty { - output.nicknameAlert.send(.invalid(text: I18N.SignUp.nicknameTextFieldPlaceholder)) - } else { - owner.nicknameCheckUseCase.checkNickname(nickname: nickname) - } - }.store(in: self.cancelBag) - - input.editButtonTapped - .withUnretained(self) - .sink { owner, nickname in - owner.editPostUseCase.editNickname(nickname: nickname) - }.store(in: self.cancelBag) - - return output - } - - private func bindOutput(output: Output, cancelBag: CancelBag) { - nicknameCheckUseCase.isNicknameValid - .asDriver() - .sink { isNicknameValid, alertText in - output.editButtonEnabled = isNicknameValid - output.nicknameAlert.send(isNicknameValid - ? .valid(text: alertText) - : .invalid(text: alertText)) - }.store(in: self.cancelBag) - - editPostUseCase.editNicknameSuccess - .asDriver() - .sink { isSuccessed in - output.editNicknameSuccessed.send(isSuccessed) - }.store(in: self.cancelBag) - } -} diff --git a/SOPT-iOS/Projects/Features/DailySoptuneFeature/Sources/DailySoptuneScene/VC/DailySoptuneResultVC.swift b/SOPT-iOS/Projects/Features/DailySoptuneFeature/Sources/DailySoptuneScene/VC/DailySoptuneResultVC.swift index 2e65a5345..73ef4a0c1 100644 --- a/SOPT-iOS/Projects/Features/DailySoptuneFeature/Sources/DailySoptuneScene/VC/DailySoptuneResultVC.swift +++ b/SOPT-iOS/Projects/Features/DailySoptuneFeature/Sources/DailySoptuneScene/VC/DailySoptuneResultVC.swift @@ -25,7 +25,6 @@ public final class DailySoptuneResultVC: UIViewController, DailySoptuneResultVie private let resultModel: DailySoptuneResultModel private lazy var receiveTodaysFortuneButtonTap: Driver = receiveTodaysFortuneCardButton.publisher(for: .touchUpInside).mapVoid().asDriver() - private let viewWillAppear = PassthroughSubject() // MARK: - UI Components @@ -78,11 +77,6 @@ public final class DailySoptuneResultVC: UIViewController, DailySoptuneResultVie self.setLayout() self.bindViewModels() } - - public override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - self.viewWillAppear.send(()) - } } // MARK: - UI & Layout @@ -144,7 +138,7 @@ private extension DailySoptuneResultVC { func bindViewModels() { let input = DailySoptuneResultViewModel .Input( - viewWillAppear: viewWillAppear.asDriver(), + viewDidLoad: Just(()).asDriver(), naviBackButtonTap: self.backButton .publisher(for: .touchUpInside) .mapVoid().asDriver(), diff --git a/SOPT-iOS/Projects/Features/DailySoptuneFeature/Sources/DailySoptuneScene/ViewModel/DailySoptuneResultViewModel.swift b/SOPT-iOS/Projects/Features/DailySoptuneFeature/Sources/DailySoptuneScene/ViewModel/DailySoptuneResultViewModel.swift index fbe9f0641..949a289cb 100644 --- a/SOPT-iOS/Projects/Features/DailySoptuneFeature/Sources/DailySoptuneScene/ViewModel/DailySoptuneResultViewModel.swift +++ b/SOPT-iOS/Projects/Features/DailySoptuneFeature/Sources/DailySoptuneScene/ViewModel/DailySoptuneResultViewModel.swift @@ -30,7 +30,7 @@ public final class DailySoptuneResultViewModel: DailySoptuneResultViewModelType // MARK: - Inputs public struct Input { - let viewWillAppear: Driver + let viewDidLoad: Driver let naviBackButtonTap: Driver let receiveTodaysFortuneCardTap: Driver let kokButtonTap: Driver @@ -57,7 +57,7 @@ extension DailySoptuneResultViewModel { let output = Output() self.bindOutput(output: output, cancelBag: cancelBag) - input.viewWillAppear + input.viewDidLoad .withUnretained(self) .sink { owner, _ in owner.useCase.getRandomUser() diff --git a/SOPT-iOS/Projects/Features/MainFeature/Sources/MainScene/VC/MainVC.swift b/SOPT-iOS/Projects/Features/MainFeature/Sources/MainScene/VC/MainVC.swift index 4686343c0..e94532668 100644 --- a/SOPT-iOS/Projects/Features/MainFeature/Sources/MainScene/VC/MainVC.swift +++ b/SOPT-iOS/Projects/Features/MainFeature/Sources/MainScene/VC/MainVC.swift @@ -136,11 +136,6 @@ extension MainVC { self?.updateUI(with: userMainInfo) }.store(in: self.cancelBag) - output.isServiceAvailable - .sink { isServiceAvailable in - print("현재 앱 서비스 사용 가능(심사 X)?: \(isServiceAvailable)") - }.store(in: self.cancelBag) - output.needNetworkAlert .sink { [weak self] in self?.presentNetworkAlertVC() diff --git a/SOPT-iOS/Projects/Features/MainFeature/Sources/MainScene/ViewModel/MainViewModel.swift b/SOPT-iOS/Projects/Features/MainFeature/Sources/MainScene/ViewModel/MainViewModel.swift index d6bcfc853..84d7208d7 100644 --- a/SOPT-iOS/Projects/Features/MainFeature/Sources/MainScene/ViewModel/MainViewModel.swift +++ b/SOPT-iOS/Projects/Features/MainFeature/Sources/MainScene/ViewModel/MainViewModel.swift @@ -46,7 +46,6 @@ public class MainViewModel: MainViewModelType { public struct Output { var needToReload = PassthroughSubject() - var isServiceAvailable = PassthroughSubject() var needNetworkAlert = PassthroughSubject() var isLoading = PassthroughSubject() } @@ -150,7 +149,6 @@ extension MainViewModel { .sink { [weak self] _ in guard let self = self else { return } self.requestAuthorizationForNotification() - self.useCase.getServiceState() self.trackAmplitude(event: .viewAppHome) self.useCase.getReportUrl() }.store(in: cancelBag) @@ -181,11 +179,6 @@ extension MainViewModel { output.needToReload.send() }.store(in: self.cancelBag) - useCase.serviceState - .sink { serviceState in - output.isServiceAvailable.send(serviceState.isAvailable) - }.store(in: self.cancelBag) - useCase.mainDescription .sink { [weak self] mainDescription in self?.mainDescription = mainDescription @@ -331,7 +324,6 @@ extension MainViewModel { func calculateMonths() -> String? { guard let userMainInfo = userMainInfo, let firstHistory = userMainInfo.historyList.last else { return nil } guard let joinDate = calculateJoinDateWithFirstHistory(history: firstHistory), let monthDifference = calculateMonthDifference(since: joinDate) else { return nil } - return String(monthDifference) } @@ -340,7 +332,7 @@ extension MainViewModel { let yearDifference = history / 2 let month = (history % 2 == 0) ? 3 : 9 // 짝수 기수는 3월, 홀수 기수는 9월 시작 // 1기를 2007년으로 계산 - return Date.from(year: yearDifference + 2007, month: month, day: 1) + return Date.from(year: yearDifference + 2007, month: month, day: 2) } // 파라미터로 넣은 날짜로 부터 현재 몇달이 지났는지 계산 diff --git a/SOPT-iOS/Projects/Features/MainFeature/Tests/Sources/MainViewModelTests/MockMainUseCase.swift b/SOPT-iOS/Projects/Features/MainFeature/Tests/Sources/MainViewModelTests/MockMainUseCase.swift index a036571fc..06e0dd3db 100644 --- a/SOPT-iOS/Projects/Features/MainFeature/Tests/Sources/MainViewModelTests/MockMainUseCase.swift +++ b/SOPT-iOS/Projects/Features/MainFeature/Tests/Sources/MainViewModelTests/MockMainUseCase.swift @@ -14,15 +14,9 @@ import Core final class MockMainUseCase: MainUseCase { var userMainInfo = PassthroughSubject() - var serviceState = PassthroughSubject() - var mainErrorOccurred = PassthroughSubject() func getUserMainInfo() { self.userMainInfo.send(UserMainInfoModel.dummyUserInfoModel[0]) } - - func getServiceState() { - self.serviceState.send(ServiceStateModel(isAvailable: true)) - } } diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/API/ConfigAPI.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/API/ConfigAPI.swift deleted file mode 100644 index 2c0614313..000000000 --- a/SOPT-iOS/Projects/Modules/Networks/Sources/API/ConfigAPI.swift +++ /dev/null @@ -1,63 +0,0 @@ -// -// ConfigAPI.swift -// Network -// -// Created by sejin on 2023/04/15. -// Copyright © 2023 SOPT-iOS. All rights reserved. -// - -import Foundation - -import Alamofire -import Moya - -public enum ConfigAPI { - case getServiceAvailability -} - -extension ConfigAPI: BaseAPI { - public static var apiType: APIType = .config - - // MARK: - Path - public var path: String { - switch self { - case .getServiceAvailability: - return "/availability" - } - } - - // MARK: - Method - public var method: Moya.Method { - switch self { - case .getServiceAvailability: - return .get - } - } - - // MARK: - Parameters - private var bodyParameters: Parameters? { - var params: Parameters = [:] - return params - } - - private var parameterEncoding: ParameterEncoding { - switch self { - default: - return JSONEncoding.default - } - } - - public var task: Task { - switch self { - default: - return .requestPlain - } - } - - public var headers: [String : String]? { - switch self { - default: - return HeaderType.json.value - } - } -} diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/API/RankAPI.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/API/RankAPI.swift index 106442493..8f50c4380 100644 --- a/SOPT-iOS/Projects/Modules/Networks/Sources/API/RankAPI.swift +++ b/SOPT-iOS/Projects/Modules/Networks/Sources/API/RankAPI.swift @@ -26,9 +26,8 @@ extension RankAPI: BaseAPI { // MARK: - Header public var headers: [String: String]? { switch self { - case .rank, .rankDetail: + default: return HeaderType.jsonWithToken.value - default: return HeaderType.json.value } } diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/API/S3API.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/API/S3API.swift index 51b698d2d..f36f8c153 100644 --- a/SOPT-iOS/Projects/Modules/Networks/Sources/API/S3API.swift +++ b/SOPT-iOS/Projects/Modules/Networks/Sources/API/S3API.swift @@ -20,7 +20,7 @@ extension S3API: BaseAPI { public var path: String { switch self { - case .getPresignedUrl: return "/mission" + case .getPresignedUrl: return "/stamp" } } diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/API/UserAPI.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/API/UserAPI.swift index 0e56ede92..2a5d1b6d9 100644 --- a/SOPT-iOS/Projects/Modules/Networks/Sources/API/UserAPI.swift +++ b/SOPT-iOS/Projects/Modules/Networks/Sources/API/UserAPI.swift @@ -15,15 +15,11 @@ import Core public enum UserAPI { case fetchSoptampUser case editSentence(sentence: String) - case getNicknameAvailable(nickname: String) - case changeNickname(nickname: String) case getUserMainInfo case withdrawal case registerPushToken(token: String) case deregisterPushToken(token: String) case fetchActiveGenerationStatus - case getNotificationIsAllowed - case optInPushNotificationInGeneral(isOn: Bool) case getNotificationSettingsInDetail case optInPushNotificationInDetail(notificationSettings: DetailNotificationOptInEntity) case appService @@ -41,10 +37,6 @@ extension UserAPI: BaseAPI { return "soptamp" case .editSentence: return "profile-message" - case .changeNickname: - return "nickname" - case .getNicknameAvailable(let nickname): - return "nickname/\(nickname)" case .getUserMainInfo: return "/main" case .withdrawal: @@ -53,10 +45,6 @@ extension UserAPI: BaseAPI { return "/push-token" case .fetchActiveGenerationStatus: return "/generation" - case .getNotificationIsAllowed: - return "/opt-in" - case .optInPushNotificationInGeneral: - return "/opt-in" case .getNotificationSettingsInDetail: return "/opt-in/detail" case .optInPushNotificationInDetail: @@ -71,10 +59,9 @@ extension UserAPI: BaseAPI { // MARK: - Method public var method: Moya.Method { switch self { - case .getNicknameAvailable, .getUserMainInfo, .fetchSoptampUser, .fetchActiveGenerationStatus, - .getNotificationIsAllowed, .getNotificationSettingsInDetail, .appService, .hotboard: + case .getUserMainInfo, .fetchSoptampUser, .fetchActiveGenerationStatus, .getNotificationSettingsInDetail, .appService, .hotboard: return .get - case .editSentence, .changeNickname, .optInPushNotificationInGeneral, .optInPushNotificationInDetail: + case .editSentence, .optInPushNotificationInDetail: return .patch case .withdrawal: return .delete @@ -89,8 +76,6 @@ extension UserAPI: BaseAPI { private var bodyParameters: Parameters? { var params: Parameters = [:] switch self { - case .changeNickname(let nickname): - params["nickname"] = nickname case .editSentence(let sentence): params["profileMessage"] = sentence case .registerPushToken(let pushToken): @@ -99,8 +84,6 @@ extension UserAPI: BaseAPI { case .deregisterPushToken(let pushToken): params["platform"] = "iOS" params["pushToken"] = pushToken - case .optInPushNotificationInGeneral(let isOn): - params["isOptIn"] = isOn case .optInPushNotificationInDetail(let optInDTO): params = optInDTO.toDictionary() default: break @@ -117,8 +100,7 @@ extension UserAPI: BaseAPI { public var task: Task { switch self { - case .changeNickname, .editSentence, .registerPushToken, - .optInPushNotificationInGeneral, .optInPushNotificationInDetail, .deregisterPushToken: + case .editSentence, .registerPushToken, .optInPushNotificationInDetail, .deregisterPushToken: return .requestParameters(parameters: bodyParameters ?? [:], encoding: parameterEncoding) default: return .requestPlain diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/Entity/GeneralNotificationOptInEntity.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/Entity/GeneralNotificationOptInEntity.swift deleted file mode 100644 index b2be4b9d0..000000000 --- a/SOPT-iOS/Projects/Modules/Networks/Sources/Entity/GeneralNotificationOptInEntity.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// GeneralNotificationOptInEntity.swift -// Network -// -// Created by Ian on 9/21/23. -// Copyright © 2023 SOPT-iOS. All rights reserved. -// - -public struct GeneralNotificationOptInEntity: Decodable { - public let isOptIn: Bool -} diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/Entity/ServiceStateEntity.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/Entity/ServiceStateEntity.swift deleted file mode 100644 index e1fe95c3f..000000000 --- a/SOPT-iOS/Projects/Modules/Networks/Sources/Entity/ServiceStateEntity.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// ServiceStateEntity.swift -// Network -// -// Created by sejin on 2023/04/15. -// Copyright © 2023 SOPT-iOS. All rights reserved. -// - -import Foundation - -public struct ServiceStateEntity: Codable { - public let isAvailable: Bool -} diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/Service/ConfigService.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/Service/ConfigService.swift deleted file mode 100644 index 5f2ed5be2..000000000 --- a/SOPT-iOS/Projects/Modules/Networks/Sources/Service/ConfigService.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// ConfigService.swift -// Network -// -// Created by sejin on 2023/04/15. -// Copyright © 2023 SOPT-iOS. All rights reserved. -// - -import Foundation -import Combine - -import Alamofire -import Moya - -public typealias DefaultConfigService = BaseService - -public protocol ConfigService { - func getServiceAvailability() -> AnyPublisher -} - -extension DefaultConfigService: ConfigService { - public func getServiceAvailability() -> AnyPublisher { - requestObjectInCombine(.getServiceAvailability) - } -} diff --git a/SOPT-iOS/Projects/Modules/Networks/Sources/Service/UserService.swift b/SOPT-iOS/Projects/Modules/Networks/Sources/Service/UserService.swift index 826562e78..a5c68f269 100644 --- a/SOPT-iOS/Projects/Modules/Networks/Sources/Service/UserService.swift +++ b/SOPT-iOS/Projects/Modules/Networks/Sources/Service/UserService.swift @@ -18,15 +18,11 @@ public typealias DefaultUserService = BaseService public protocol UserService { func fetchSoptampUser() -> AnyPublisher func editSentence(sentence: String) -> AnyPublisher - func getNicknameAvailable(nickname: String) -> AnyPublisher - func changeNickname(nickname: String) -> AnyPublisher func getUserMainInfo() -> AnyPublisher func withdraw() -> AnyPublisher func registerPushToken(with token: String) -> AnyPublisher func deregisterPushToken(with token: String) -> AnyPublisher func fetchActiveGenerationStatus() -> AnyPublisher - func getNotificationIsAllowed() -> AnyPublisher - func optInPushNotificationInGeneral(to isOn: Bool) -> AnyPublisher func getNotificationSettingsInDetail() -> AnyPublisher func optInPushNotificationInDetail(notificationSettings: DetailNotificationOptInEntity) -> AnyPublisher func appService() -> AnyPublisher<[AppServiceEntity], Error> @@ -42,14 +38,6 @@ extension DefaultUserService: UserService { requestObjectInCombine(.editSentence(sentence: sentence)) } - public func getNicknameAvailable(nickname: String) -> AnyPublisher { - requestObjectInCombineNoResult(.getNicknameAvailable(nickname: nickname)) - } - - public func changeNickname(nickname: String) -> AnyPublisher { - requestObjectInCombineNoResult(.changeNickname(nickname: nickname)) - } - public func getUserMainInfo() -> AnyPublisher { requestObjectWithNetworkErrorInCombine(.getUserMainInfo) } @@ -73,14 +61,6 @@ extension DefaultUserService: UserService { public func fetchActiveGenerationStatus() -> AnyPublisher { requestObjectInCombine(.fetchActiveGenerationStatus) } - - public func getNotificationIsAllowed() -> AnyPublisher { - requestObjectInCombine(.getNotificationIsAllowed) - } - - public func optInPushNotificationInGeneral(to isOn: Bool) -> AnyPublisher { - requestObjectInCombine(.optInPushNotificationInGeneral(isOn: isOn)) - } public func getNotificationSettingsInDetail() -> AnyPublisher { requestObjectInCombine(.getNotificationSettingsInDetail) diff --git a/SOPT-iOS/Projects/SOPT-iOS/Sources/Dependency/RegisterDependencies.swift b/SOPT-iOS/Projects/SOPT-iOS/Sources/Dependency/RegisterDependencies.swift index 204c011e1..9d343ba45 100644 --- a/SOPT-iOS/Projects/SOPT-iOS/Sources/Dependency/RegisterDependencies.swift +++ b/SOPT-iOS/Projects/SOPT-iOS/Sources/Dependency/RegisterDependencies.swift @@ -38,7 +38,6 @@ extension AppDelegate { implement: { MainRepository( userService: DefaultUserService(), - configService: DefaultConfigService(), descriptionService: DefaultDescriptionService(), pokeService: DefaultPokeService(), stampService: DefaultStampService() @@ -80,14 +79,6 @@ extension AppDelegate { ) } ) - container.register( - interface: SignUpRepositoryInterface.self, - implement: { - SignUpRepository( - service: DefaultUserService() - ) - } - ) container.register( interface: MissionListRepositoryInterface.self, implement: {