-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refactor/#84] MVVM + Combine 리펙토링 구현 완료
- Loading branch information
Showing
7 changed files
with
99 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
..._iOS/Projects/Features/MyPageFeature/Sources/Refactor_MyFeature/Service/API/UserAPI.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// UserAPI.swift | ||
// MyPageFeatureInterface | ||
// | ||
// Created by 류희재 on 8/13/24. | ||
// Copyright © 2024 HMH-iOS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
import Moya | ||
import Networks | ||
|
||
enum UserAPI { | ||
case getUserData | ||
} | ||
|
||
extension UserAPI: BaseAPI { | ||
public static var apiType: APIType = .user | ||
|
||
var headers: [String : String]? { | ||
switch self { | ||
case .getUserData: | ||
return ["Content-Type": "application/json", | ||
"OS": "iOS", | ||
"auth": ""] | ||
} | ||
} | ||
|
||
var path: String { | ||
switch self { | ||
case .getUserData: | ||
return "user" | ||
} | ||
} | ||
|
||
var method: Moya.Method { | ||
switch self { | ||
case .getUserData: | ||
return .get | ||
} | ||
} | ||
|
||
var task: Moya.Task { | ||
switch self { | ||
case .getUserData: | ||
return .requestPlain | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters