parent
5532b1bdcc
commit
97a3637a7b
|
@ -31,7 +31,7 @@ enum ContentApi {
|
||||||
case modifyComment(request: ModifyCommentRequest)
|
case modifyComment(request: ModifyCommentRequest)
|
||||||
case getNewContentThemeList
|
case getNewContentThemeList
|
||||||
case getNewContentAllOfTheme(theme: String, isAdultContentVisible: Bool, contentType: ContentType, page: Int, size: Int)
|
case getNewContentAllOfTheme(theme: String, isAdultContentVisible: Bool, contentType: ContentType, page: Int, size: Int)
|
||||||
case getAudioContentListByCurationId(curationId: Int, page: Int, size: Int, sort: ContentCurationViewModel.Sort)
|
case getAudioContentListByCurationId(curationId: Int, isAdultContentVisible: Bool, contentType: ContentType, page: Int, size: Int, sort: ContentCurationViewModel.Sort)
|
||||||
case getContentRanking(page: Int, size: Int, sortType: String)
|
case getContentRanking(page: Int, size: Int, sortType: String)
|
||||||
case getContentRankingSortType
|
case getContentRankingSortType
|
||||||
case pinContent(contentId: Int)
|
case pinContent(contentId: Int)
|
||||||
|
@ -112,7 +112,7 @@ extension ContentApi: TargetType {
|
||||||
case .getNewContentAllOfTheme:
|
case .getNewContentAllOfTheme:
|
||||||
return "/audio-content/main/new/all"
|
return "/audio-content/main/new/all"
|
||||||
|
|
||||||
case .getAudioContentListByCurationId(let curationId, _, _, _):
|
case .getAudioContentListByCurationId(let curationId, _, _, _, _, _):
|
||||||
return "/audio-content/curation/\(curationId)"
|
return "/audio-content/curation/\(curationId)"
|
||||||
|
|
||||||
case .getContentRanking:
|
case .getContentRanking:
|
||||||
|
@ -250,8 +250,10 @@ extension ContentApi: TargetType {
|
||||||
|
|
||||||
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
|
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
|
||||||
|
|
||||||
case .getAudioContentListByCurationId(_, let page, let size, let sort):
|
case .getAudioContentListByCurationId(_, let isAdultContentVisible, let contentType, let page, let size, let sort):
|
||||||
let parameters = [
|
let parameters = [
|
||||||
|
"isAdultContentVisible": isAdultContentVisible,
|
||||||
|
"contentType": contentType,
|
||||||
"page": page - 1,
|
"page": page - 1,
|
||||||
"size": size,
|
"size": size,
|
||||||
"sort-type": sort
|
"sort-type": sort
|
||||||
|
|
|
@ -124,7 +124,16 @@ final class ContentRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getAudioContentListByCurationId(curationId: Int, page: Int, size: Int, sort: ContentCurationViewModel.Sort) -> AnyPublisher<Response, MoyaError> {
|
func getAudioContentListByCurationId(curationId: Int, page: Int, size: Int, sort: ContentCurationViewModel.Sort) -> AnyPublisher<Response, MoyaError> {
|
||||||
return api.requestPublisher(.getAudioContentListByCurationId(curationId: curationId, page: page, size: size, sort: sort))
|
return api.requestPublisher(
|
||||||
|
.getAudioContentListByCurationId(
|
||||||
|
curationId: curationId,
|
||||||
|
isAdultContentVisible: UserDefaults.isAdultContentVisible(),
|
||||||
|
contentType: ContentType(rawValue: UserDefaults.string(forKey: .contentPreference)) ?? ContentType.ALL,
|
||||||
|
page: page,
|
||||||
|
size: size,
|
||||||
|
sort: sort
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getContentRankingSortType() -> AnyPublisher<Response, MoyaError> {
|
func getContentRankingSortType() -> AnyPublisher<Response, MoyaError> {
|
||||||
|
|
Loading…
Reference in New Issue