큐레이션 전체보기 페이지 추가

This commit is contained in:
Yu Sung
2023-09-27 21:16:39 +09:00
parent fd356451ae
commit 658cff20eb
10 changed files with 243 additions and 4 deletions

View File

@@ -28,6 +28,7 @@ enum ContentApi {
case modifyComment(request: ModifyCommentRequest)
case getNewContentThemeList
case getNewContentAllOfTheme(theme: String, page: Int, size: Int)
case getAudioContentListByCurationId(curationId: Int, page: Int, size: Int, sort: ContentCurationViewModel.Sort)
}
extension ContentApi: TargetType {
@@ -93,12 +94,15 @@ extension ContentApi: TargetType {
case .getNewContentAllOfTheme:
return "/audio-content/main/new/all"
case .getAudioContentListByCurationId(let curationId, _, _, _):
return "/audio-content/curation/\(curationId)"
}
}
var method: Moya.Method {
switch self {
case .getAudioContentList, .getAudioContentDetail, .getOrderList, .getAudioContentThemeList, .getAudioContentCommentList, .getAudioContentCommentReplyList, .getMain, .getNewContentOfTheme, .getNewContentThemeList, .getNewContentAllOfTheme:
case .getAudioContentList, .getAudioContentDetail, .getOrderList, .getAudioContentThemeList, .getAudioContentCommentList, .getAudioContentCommentReplyList, .getMain, .getNewContentOfTheme, .getNewContentThemeList, .getNewContentAllOfTheme, .getAudioContentListByCurationId:
return .get
case .likeContent, .modifyAudioContent, .modifyComment:
@@ -199,6 +203,15 @@ extension ContentApi: TargetType {
"size": size
] as [String : Any]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
case .getAudioContentListByCurationId(_, let page, let size, let sort):
let parameters = [
"page": page - 1,
"size": size,
"sort-type": sort
] as [String : Any]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
}
}