라이브 메인 페이지

This commit is contained in:
Yu Sung
2023-08-10 12:32:20 +09:00
parent 2456c897c3
commit f8bab4c232
42 changed files with 1873 additions and 2 deletions

View File

@@ -0,0 +1,56 @@
//
// LiveRecommendApi.swift
// SodaLive
//
// Created by klaus on 2023/08/09.
//
import Foundation
import Moya
enum LiveRecommendApi {
case getFollowedChannelList
case getRecommendChannelList
case getRecommendLive
}
extension LiveRecommendApi: TargetType {
var baseURL: URL {
return URL(string: BASE_URL)!
}
var path: String {
switch self {
case .getFollowedChannelList:
return "/live/recommend/following/channel/list"
case .getRecommendChannelList:
return "/live/recommend/channel"
case .getRecommendLive:
return "/live/recommend"
}
}
var method: Moya.Method {
switch self {
case .getFollowedChannelList,
.getRecommendChannelList,
.getRecommendLive:
return .get
}
}
var task: Moya.Task {
switch self {
case .getFollowedChannelList,
.getRecommendChannelList,
.getRecommendLive:
return .requestPlain
}
}
var headers: [String : String]? {
return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
}
}