콘텐츠 전체보기

- 카테고리 추가
This commit is contained in:
Yu Sung
2024-02-07 15:09:48 +09:00
parent 638d00ffc3
commit 62904d96b1
7 changed files with 196 additions and 10 deletions

View File

@@ -12,9 +12,10 @@ import Moya
final class ContentRepository {
private let api = MoyaProvider<ContentApi>()
private let categoryApi = MoyaProvider<CategoryApi>()
func getAudioContentList(userId: Int, page: Int, size: Int, sort: ContentListViewModel.Sort) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getAudioContentList(userId: userId, page: page, size: size, sort: sort))
func getAudioContentList(userId: Int, categoryId: Int, page: Int, size: Int, sort: ContentListViewModel.Sort) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getAudioContentList(userId: userId, categoryId: categoryId, page: page, size: size, sort: sort))
}
func getAudioContentDetail(audioContentId: Int) -> AnyPublisher<Response, MoyaError> {
@@ -120,4 +121,8 @@ final class ContentRepository {
func unpinContent(contentId: Int) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.unpinContent(contentId: contentId))
}
func getCategoryList(creatorId: Int) -> AnyPublisher<Response, MoyaError> {
return categoryApi.requestPublisher(.getCategoryList(creatorId: creatorId))
}
}