마이페이지 추가

This commit is contained in:
Yu Sung
2023-08-10 16:14:12 +09:00
parent 80ff04f825
commit d06f4d6a36
40 changed files with 979 additions and 3 deletions

View File

@@ -0,0 +1,44 @@
//
// AuthApi.swift
// SodaLive
//
// Created by klaus on 2023/08/10.
//
import Foundation
import Moya
enum AuthApi {
case auth(request: AuthVerifyRequest)
}
extension AuthApi: TargetType {
var baseURL: URL {
return URL(string: BASE_URL)!
}
var path: String {
switch self {
case .auth:
return "/auth"
}
}
var method: Moya.Method {
return .post
}
var task: Task {
switch self {
case .auth(let request):
return .requestJSONEncodable(request)
}
}
var headers: [String : String]? {
switch self {
default:
return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
}
}
}