룰렛 설정 다이얼로그 뷰 추가

This commit is contained in:
Yu Sung
2023-12-06 16:43:41 +09:00
parent 9622e9b55d
commit ff7144f708
15 changed files with 536 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
//
// RouletteApi.swift
// SodaLive
//
// Created by klaus on 2023/12/06.
//
import Foundation
import Moya
enum RouletteApi {
case getRoulette(creatorId: Int)
}
extension RouletteApi: TargetType {
var baseURL: URL {
return URL(string: BASE_URL)!
}
var path: String {
switch self {
case .getRoulette:
return "/roulette"
}
}
var method: Moya.Method {
switch self {
case .getRoulette:
return .get
}
}
var task: Moya.Task {
switch self {
case .getRoulette(let creatorId):
let parameters = [
"creatorId": creatorId
] as [String : Any]
return .requestParameters(
parameters: parameters,
encoding: URLEncoding.queryString
)
}
}
var headers: [String : String]? {
return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
}
}