SodaLive
Preview Content
Resources
Sources
Agora
App
Common
Content
CustomView
Debug
Dialog
Explorer
Extensions
Follow
Font
FortuneWheel
IAP
ImagePicker
Keyboard
Live
Main
Message
MyPage
NavigationBar
Onboarding
Report
CheersReportDialogView.swift
ProfileReportDialogView.swift
ProfileReportMenuView.swift
ReportApi.swift
ReportRepository.swift
ReportRequest.swift
UserBlockConfirmDialogView.swift
UserReportDialogView.swift
Settings
Shape
Splash
UI
User
Utils
ContentView.swift
SodaLive.entitlements
SodaLive.xcworkspace
generated
.gitignore
Podfile
Podfile.lock
SodaLive-dev.entitlements
model-SodaLive-dev.json
model-SodaLive.json
45 lines
805 B
Swift
45 lines
805 B
Swift
//
|
|
// ReportApi.swift
|
|
// SodaLive
|
|
//
|
|
// Created by klaus on 2023/08/11.
|
|
//
|
|
|
|
import Foundation
|
|
import Moya
|
|
|
|
enum ReportApi {
|
|
case report(request: ReportRequest)
|
|
}
|
|
|
|
extension ReportApi: TargetType {
|
|
var baseURL: URL {
|
|
return URL(string: BASE_URL)!
|
|
}
|
|
|
|
var path: String {
|
|
switch self {
|
|
case .report:
|
|
return "/report"
|
|
}
|
|
}
|
|
|
|
var method: Moya.Method {
|
|
switch self {
|
|
case .report:
|
|
return .post
|
|
}
|
|
}
|
|
|
|
var task: Task {
|
|
switch self {
|
|
case .report(let request):
|
|
return .requestJSONEncodable(request)
|
|
}
|
|
}
|
|
|
|
var headers: [String : String]? {
|
|
return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
|
|
}
|
|
}
|