diff --git a/Projects/Core/Network/Interface/Sources/API/OAuthProvider.swift b/Projects/Core/Network/Interface/Sources/API/OAuthProvider.swift index 68bb5dab..fda0b506 100644 --- a/Projects/Core/Network/Interface/Sources/API/OAuthProvider.swift +++ b/Projects/Core/Network/Interface/Sources/API/OAuthProvider.swift @@ -8,6 +8,6 @@ import Foundation public enum OAuthProvider: String { - case kakao - case apple + case kakao = "KAKAO" + case apple = "APPLE" } diff --git a/Projects/Domain/OAuth/Interface/Sources/Model/OAuthResult.swift b/Projects/Domain/OAuth/Interface/Sources/Model/OAuthResult.swift index 60f92263..cb0bdcc7 100644 --- a/Projects/Domain/OAuth/Interface/Sources/Model/OAuthResult.swift +++ b/Projects/Domain/OAuth/Interface/Sources/Model/OAuthResult.swift @@ -8,15 +8,16 @@ import Foundation public enum OAuthType: String { - case kakao - case apple + case kakao = "KAKAO" + case apple = "APPLE" case none } -public struct OAuthResult: Equatable { - public let oAuthType: OAuthType - - public init(oAuthType: OAuthType) { - self.oAuthType = oAuthType +public enum OAuthResult: Equatable { + public static func == (lhs: OAuthResult, rhs: OAuthResult) -> Bool { + return lhs.self == rhs.self } + + case success(OAuthType) + case failure(Error) } diff --git a/Projects/Domain/Sources/DomainError.swift b/Projects/Domain/Sources/DomainError.swift deleted file mode 100644 index 59ec9ea9..00000000 --- a/Projects/Domain/Sources/DomainError.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// DomainError.swift -// Domain -// -// Created by Derrick kim on 6/20/24. -// - -import Foundation - -public enum DomainError: LocalizedError { - case authError(AuthError) - case recordError(RecordError) -} diff --git a/Projects/Feature/Onboarding/Interface/Sources/Errors/ErrorViewModel.swift b/Projects/Feature/Onboarding/Interface/Sources/Errors/ErrorViewModel.swift deleted file mode 100644 index 6a1ead87..00000000 --- a/Projects/Feature/Onboarding/Interface/Sources/Errors/ErrorViewModel.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ErrorViewModel.swift -// FeatureOnboarding -// -// Created by Derrick kim on 6/20/24. -// - -import Domain - -import Foundation - -struct ErrorViewModel { - let description: String - - init(domainError: DomainError) { - switch domainError { - case .authError(let authError): - self.description = "잘못된 인증입니다. \(authError.localizedDescription)" - case .recordError(let recordError): - self.description = "로그인 정보가 없습니다. \(recordError.localizedDescription)" - } - } -}