커뮤니티 게시물 등록 API 적용,
채널 프로필 API - 커뮤니티 게시물 추가
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// CreatorCommunityApi.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/12/19.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Moya
|
||||
|
||||
enum CreatorCommunityApi {
|
||||
case createCommunityPost(parameters: [MultipartFormData])
|
||||
}
|
||||
|
||||
extension CreatorCommunityApi: TargetType {
|
||||
var baseURL: URL {
|
||||
return URL(string: BASE_URL)!
|
||||
}
|
||||
|
||||
var path: String {
|
||||
switch self {
|
||||
case .createCommunityPost:
|
||||
return "/creator-community"
|
||||
}
|
||||
}
|
||||
|
||||
var method: Moya.Method {
|
||||
switch self {
|
||||
case .createCommunityPost:
|
||||
return .post
|
||||
}
|
||||
}
|
||||
|
||||
var task: Moya.Task {
|
||||
switch self {
|
||||
case .createCommunityPost(let parameters):
|
||||
return .uploadMultipart(parameters)
|
||||
}
|
||||
}
|
||||
|
||||
var headers: [String : String]? {
|
||||
return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user