From dfd12a95479fe58ac4a87aede1c5ad93b5e0b494 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 19 Mar 2025 16:37:45 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=98=ED=85=90=EC=B8=A0=20=ED=83=AD=20?= =?UTF-8?q?=ED=99=88=20-=20=EB=8B=A8=ED=8E=B8=20=EB=9E=AD=ED=82=B9?= =?UTF-8?q?=EC=97=90=2019=EA=B8=88=20=EC=BD=98=ED=85=90=EC=B8=A0=20?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=EC=84=A4=EC=A0=95=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SodaLive/Sources/Content/ContentApi.swift | 6 ++++-- SodaLive/Sources/Content/ContentRepository.swift | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/SodaLive/Sources/Content/ContentApi.swift b/SodaLive/Sources/Content/ContentApi.swift index d163a30..31e0fd7 100644 --- a/SodaLive/Sources/Content/ContentApi.swift +++ b/SodaLive/Sources/Content/ContentApi.swift @@ -32,7 +32,7 @@ enum ContentApi { case getNewContentThemeList(isAdultContentVisible: Bool, contentType: ContentType) case getNewContentAllOfTheme(isFree: Bool, theme: String, isAdultContentVisible: Bool, contentType: ContentType, page: Int, size: Int) 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(isAdultContentVisible: Bool, contentType: ContentType, page: Int, size: Int, sortType: String) case getContentRankingSortType case pinContent(contentId: Int) case unpinContent(contentId: Int) @@ -368,8 +368,10 @@ extension ContentApi: TargetType { return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString) - case .getContentRanking(let page, let size, let sortType): + case .getContentRanking(let isAdultContentVisible, let contentType, let page, let size, let sortType): let parameters = [ + "isAdultContentVisible": isAdultContentVisible, + "contentType": contentType, "page": page - 1, "size": size, "sort-type": sortType diff --git a/SodaLive/Sources/Content/ContentRepository.swift b/SodaLive/Sources/Content/ContentRepository.swift index 55d5260..31f959c 100644 --- a/SodaLive/Sources/Content/ContentRepository.swift +++ b/SodaLive/Sources/Content/ContentRepository.swift @@ -148,7 +148,15 @@ final class ContentRepository { } func getContentRanking(page: Int, size: Int, sortType: String = "매출") -> AnyPublisher { - return api.requestPublisher(.getContentRanking(page: page, size: size, sortType: sortType)) + return api.requestPublisher( + .getContentRanking( + isAdultContentVisible: UserDefaults.isAdultContentVisible(), + contentType: ContentType(rawValue: UserDefaults.string(forKey: .contentPreference)) ?? ContentType.ALL, + page: page, + size: size, + sortType: sortType + ) + ) } func pinContent(contentId: Int) -> AnyPublisher {