From dfa5853ddf35f419ff311a320361b972641323fb Mon Sep 17 00:00:00 2001 From: derrickkim0109 Date: Tue, 25 Jun 2024 00:22:55 +0900 Subject: [PATCH 1/2] =?UTF-8?q?remove:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20Error=20=EA=B0=9D=EC=B2=B4=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Domain/Sources/DomainError.swift | 13 ----------- .../Sources/Errors/ErrorViewModel.swift | 23 ------------------- 2 files changed, 36 deletions(-) delete mode 100644 Projects/Domain/Sources/DomainError.swift delete mode 100644 Projects/Feature/Onboarding/Interface/Sources/Errors/ErrorViewModel.swift 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)" - } - } -} From 42fc30c166f1426ffcf81e8066e5ca90e0c8b2f8 Mon Sep 17 00:00:00 2001 From: derrickkim0109 Date: Tue, 25 Jun 2024 00:24:07 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20Request=20Body=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EC=B6=B0=20case=20String=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Interface/Sources/API/OAuthProvider.swift | 4 ++-- .../Interface/Sources/Model/OAuthResult.swift | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) 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) }