feat: 포인트 내역 UI 추가
This commit is contained in:
55
SodaLive/Sources/MyPage/Point/PointStatusApi.swift
Normal file
55
SodaLive/Sources/MyPage/Point/PointStatusApi.swift
Normal file
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// PointStatusApi.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 5/20/25.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Moya
|
||||
|
||||
enum PointStatusApi {
|
||||
case getPointStatus
|
||||
case getPointRewardStatus
|
||||
case getPointUseStatus
|
||||
}
|
||||
|
||||
extension PointStatusApi: TargetType {
|
||||
var baseURL: URL {
|
||||
return URL(string: BASE_URL)!
|
||||
}
|
||||
|
||||
var path: String {
|
||||
switch self {
|
||||
case .getPointStatus:
|
||||
return "/point/status"
|
||||
|
||||
case .getPointRewardStatus:
|
||||
return "/point/status/reward"
|
||||
|
||||
case .getPointUseStatus:
|
||||
return "/point/status/use"
|
||||
}
|
||||
}
|
||||
|
||||
var method: Moya.Method {
|
||||
return .get
|
||||
}
|
||||
|
||||
var task: Moya.Task {
|
||||
switch self {
|
||||
case .getPointStatus:
|
||||
return .requestPlain
|
||||
|
||||
case .getPointRewardStatus, .getPointUseStatus:
|
||||
return .requestParameters(
|
||||
parameters: ["timezone": TimeZone.current.identifier],
|
||||
encoding: URLEncoding.queryString
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
var headers: [String : String]? {
|
||||
return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user