Skip to content

Commit 95ac12f

Browse files
committed
✨ :: [#40] UserAPI-MyInfo 추가
1 parent 0ed3ac9 commit 95ac12f

File tree

7 files changed

+8
-88
lines changed

7 files changed

+8
-88
lines changed

Package.resolved

Lines changed: 0 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ let package = Package(
1919
name: "Package",
2020
dependencies: [
2121
.package(url: "https://github.com/Moya/Moya.git", from: "15.0.0"),
22-
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "11.5.0"),
2322
.package(url: "https://github.com/google/GoogleSignIn-iOS.git", from: "8.0.0")
2423
]
2524
)

Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ public extension TargetDependency {
66

77
public extension TargetDependency.SPM {
88
static let Moya = TargetDependency.external(name: "Moya")
9-
static let Firebase = TargetDependency.external(name: "FirebaseAuth")
109
static let GoogleSignIn = TargetDependency.external(name: "GoogleSignIn")
1110
}
1211

Projects/App/Project.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ let targets: [Target] = [
3333
scripts: scripts,
3434
dependencies: [
3535
.SPM.Moya,
36-
.SPM.Firebase,
3736
.SPM.GoogleSignIn,
3837
.domain(target: .Domain)
3938
],

Projects/App/Sources/Application/GPleApp.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import SwiftUI
22
import FirebaseCore
33
import Firebase
44

5-
65
class AppDelegate: UIResponder, UIApplicationDelegate {
76
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
87
FirebaseApp.configure()

Projects/App/Sources/Feature/PostCreateFeature/Sources/PostViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public final class PostViewModel: ObservableObject {
213213
}
214214

215215
public func myInfo(completion: @escaping (Bool) -> Void) {
216-
userProvider.request(.userInfoInput(authorization: accessToken)) { result in
216+
userProvider.request(.myInfo(authorization: accessToken)) { result in
217217
switch result {
218218
case let .success(response):
219219
do {

Projects/Domain/Sources/API/User/UserAPI.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Moya
33

44
public enum UserAPI {
55
case userInfoInput(authorization: String, name: String, number: String, file: Data?)
6+
case myInfo(authorization: String)
67
}
78

89
extension UserAPI: TargetType {
@@ -12,7 +13,7 @@ extension UserAPI: TargetType {
1213

1314
public var path: String {
1415
switch self {
15-
case .userInfoInput:
16+
case .userInfoInput, .myInfo:
1617
return "/user/profile"
1718
}
1819
}
@@ -21,6 +22,8 @@ extension UserAPI: TargetType {
2122
switch self {
2223
case .userInfoInput:
2324
return .post
25+
case .myInfo:
26+
return .get
2427
}
2528
}
2629

@@ -42,12 +45,14 @@ extension UserAPI: TargetType {
4245
}
4346

4447
return .uploadMultipart(formData)
48+
case .myInfo:
49+
return .requestPlain
4550
}
4651
}
4752

4853
public var headers: [String : String]? {
4954
switch self {
50-
case .userInfoInput(let authorization, _, _, _):
55+
case .userInfoInput(let authorization, _, _, _), .myInfo(let authorization):
5156
return [
5257
"Authorization": "Bearer \(authorization)"
5358
]

0 commit comments

Comments
 (0)