From 95ac12f322e412fffbe9d54bc352bfee7251d5d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxixn2=E2=80=9D?= Date: Mon, 30 Dec 2024 10:28:09 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20::=20[#40]=20UserAPI-MyInfo=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Package.resolved | 81 ------------------- Package.swift | 1 - .../Dependency+SPM.swift | 1 - Projects/App/Project.swift | 1 - .../App/Sources/Application/GPleApp.swift | 1 - .../Sources/PostViewModel.swift | 2 +- .../Domain/Sources/API/User/UserAPI.swift | 9 ++- 7 files changed, 8 insertions(+), 88 deletions(-) diff --git a/Package.resolved b/Package.resolved index 68c14bb..8811f8a 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,14 +1,5 @@ { "pins" : [ - { - "identity" : "abseil-cpp-binary", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/abseil-cpp-binary.git", - "state" : { - "revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27", - "version" : "1.2024011602.0" - } - }, { "identity" : "alamofire", "kind" : "remoteSourceControl", @@ -36,33 +27,6 @@ "version" : "1.7.6" } }, - { - "identity" : "firebase-ios-sdk", - "kind" : "remoteSourceControl", - "location" : "https://github.com/firebase/firebase-ios-sdk.git", - "state" : { - "revision" : "2e02253fd1ce99145bcbf1bb367ccf61bd0ca46b", - "version" : "11.6.0" - } - }, - { - "identity" : "googleappmeasurement", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/GoogleAppMeasurement.git", - "state" : { - "revision" : "4f234bcbdae841d7015258fbbf8e7743a39b8200", - "version" : "11.4.0" - } - }, - { - "identity" : "googledatatransport", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/GoogleDataTransport.git", - "state" : { - "revision" : "617af071af9aa1d6a091d59a202910ac482128f9", - "version" : "10.1.0" - } - }, { "identity" : "googlesignin-ios", "kind" : "remoteSourceControl", @@ -81,15 +45,6 @@ "version" : "8.0.2" } }, - { - "identity" : "grpc-binary", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/grpc-binary.git", - "state" : { - "revision" : "f56d8fc3162de9a498377c7b6cea43431f4f5083", - "version" : "1.65.1" - } - }, { "identity" : "gtm-session-fetcher", "kind" : "remoteSourceControl", @@ -108,24 +63,6 @@ "version" : "4.1.1" } }, - { - "identity" : "interop-ios-for-google-sdks", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/interop-ios-for-google-sdks.git", - "state" : { - "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648", - "version" : "100.0.0" - } - }, - { - "identity" : "leveldb", - "kind" : "remoteSourceControl", - "location" : "https://github.com/firebase/leveldb.git", - "state" : { - "revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1", - "version" : "1.22.5" - } - }, { "identity" : "moya", "kind" : "remoteSourceControl", @@ -135,15 +72,6 @@ "version" : "15.0.3" } }, - { - "identity" : "nanopb", - "kind" : "remoteSourceControl", - "location" : "https://github.com/firebase/nanopb.git", - "state" : { - "revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1", - "version" : "2.30910.0" - } - }, { "identity" : "promises", "kind" : "remoteSourceControl", @@ -170,15 +98,6 @@ "revision" : "c7c7d2cf50a3211fe2843f76869c698e4e417930", "version" : "6.8.0" } - }, - { - "identity" : "swift-protobuf", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-protobuf.git", - "state" : { - "revision" : "ebc7251dd5b37f627c93698e4374084d98409633", - "version" : "1.28.2" - } } ], "version" : 2 diff --git a/Package.swift b/Package.swift index 23b365c..a8e6b18 100644 --- a/Package.swift +++ b/Package.swift @@ -19,7 +19,6 @@ let package = Package( name: "Package", dependencies: [ .package(url: "https://github.com/Moya/Moya.git", from: "15.0.0"), - .package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "11.5.0"), .package(url: "https://github.com/google/GoogleSignIn-iOS.git", from: "8.0.0") ] ) diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift index 1e3cb18..642ccca 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift @@ -6,7 +6,6 @@ public extension TargetDependency { public extension TargetDependency.SPM { static let Moya = TargetDependency.external(name: "Moya") - static let Firebase = TargetDependency.external(name: "FirebaseAuth") static let GoogleSignIn = TargetDependency.external(name: "GoogleSignIn") } diff --git a/Projects/App/Project.swift b/Projects/App/Project.swift index 8ec87b8..0791765 100644 --- a/Projects/App/Project.swift +++ b/Projects/App/Project.swift @@ -33,7 +33,6 @@ let targets: [Target] = [ scripts: scripts, dependencies: [ .SPM.Moya, - .SPM.Firebase, .SPM.GoogleSignIn, .domain(target: .Domain) ], diff --git a/Projects/App/Sources/Application/GPleApp.swift b/Projects/App/Sources/Application/GPleApp.swift index d57b80b..a807237 100644 --- a/Projects/App/Sources/Application/GPleApp.swift +++ b/Projects/App/Sources/Application/GPleApp.swift @@ -2,7 +2,6 @@ import SwiftUI import FirebaseCore import Firebase - class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() diff --git a/Projects/App/Sources/Feature/PostCreateFeature/Sources/PostViewModel.swift b/Projects/App/Sources/Feature/PostCreateFeature/Sources/PostViewModel.swift index d1d9d53..ddefcd3 100644 --- a/Projects/App/Sources/Feature/PostCreateFeature/Sources/PostViewModel.swift +++ b/Projects/App/Sources/Feature/PostCreateFeature/Sources/PostViewModel.swift @@ -213,7 +213,7 @@ public final class PostViewModel: ObservableObject { } public func myInfo(completion: @escaping (Bool) -> Void) { - userProvider.request(.userInfoInput(authorization: accessToken)) { result in + userProvider.request(.myInfo(authorization: accessToken)) { result in switch result { case let .success(response): do { diff --git a/Projects/Domain/Sources/API/User/UserAPI.swift b/Projects/Domain/Sources/API/User/UserAPI.swift index 0f3b9f7..d8aa263 100644 --- a/Projects/Domain/Sources/API/User/UserAPI.swift +++ b/Projects/Domain/Sources/API/User/UserAPI.swift @@ -3,6 +3,7 @@ import Moya public enum UserAPI { case userInfoInput(authorization: String, name: String, number: String, file: Data?) + case myInfo(authorization: String) } extension UserAPI: TargetType { @@ -12,7 +13,7 @@ extension UserAPI: TargetType { public var path: String { switch self { - case .userInfoInput: + case .userInfoInput, .myInfo: return "/user/profile" } } @@ -21,6 +22,8 @@ extension UserAPI: TargetType { switch self { case .userInfoInput: return .post + case .myInfo: + return .get } } @@ -42,12 +45,14 @@ extension UserAPI: TargetType { } return .uploadMultipart(formData) + case .myInfo: + return .requestPlain } } public var headers: [String : String]? { switch self { - case .userInfoInput(let authorization, _, _, _): + case .userInfoInput(let authorization, _, _, _), .myInfo(let authorization): return [ "Authorization": "Bearer \(authorization)" ] From 452f1a6a5f1423788ffa46d993d9ab63269cf7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxixn2=E2=80=9D?= Date: Mon, 30 Dec 2024 10:30:12 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=A5=20::=20[#40]=20Firebase=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/App/Sources/Application/GPleApp.swift | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Projects/App/Sources/Application/GPleApp.swift b/Projects/App/Sources/Application/GPleApp.swift index a807237..bcfb229 100644 --- a/Projects/App/Sources/Application/GPleApp.swift +++ b/Projects/App/Sources/Application/GPleApp.swift @@ -1,17 +1,7 @@ import SwiftUI -import FirebaseCore -import Firebase - -class AppDelegate: UIResponder, UIApplicationDelegate { - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - FirebaseApp.configure() - return true - } -} @main struct GoogleSignInProjectApp: App { - @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate @StateObject var viewModel: LoginViewModel = LoginViewModel() @StateObject var userInfoViewModel: UserInfoViewModel = UserInfoViewModel()