콘텐츠 메인

- 남성향, 여성향 콘텐츠 설정 적용
- 19금 콘텐츠 보기 여부 설정 적용
This commit is contained in:
Yu Sung
2025-03-18 20:49:43 +09:00
parent cf5f798bb3
commit d5e1acb1c3
10 changed files with 262 additions and 72 deletions

View File

@@ -15,7 +15,12 @@ final class ContentMainTabContentRepository {
private let api = MoyaProvider<ContentApi>()
func getContentMainContent() -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getContentMainContent)
return api.requestPublisher(
.getContentMainContent(
isAdultContentVisible: UserDefaults.isAdultContentVisible(),
contentType: ContentType(rawValue: UserDefaults.string(forKey: .contentPreference)) ?? ContentType.ALL
)
)
}
func getNewContentOfTheme(theme: String) -> AnyPublisher<Response, MoyaError> {
@@ -29,14 +34,31 @@ final class ContentMainTabContentRepository {
}
func getContentRanking(sortType: String) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getDailyContentRanking(sortType: sortType))
return api.requestPublisher(
.getDailyContentRanking(
sortType: sortType,
isAdultContentVisible: UserDefaults.isAdultContentVisible(),
contentType: ContentType(rawValue: UserDefaults.string(forKey: .contentPreference)) ?? ContentType.ALL
)
)
}
func getRecommendContentByTag(tag: String) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getRecommendContentByTag(tag: tag))
return api.requestPublisher(
.getRecommendContentByTag(
tag: tag,
contentType: ContentType(rawValue: UserDefaults.string(forKey: .contentPreference)) ?? ContentType.ALL
)
)
}
func getPopularContentByCreator(creatorId: Int) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getContentMainContentPopularContentByCreator(creatorId: creatorId))
return api.requestPublisher(
.getContentMainContentPopularContentByCreator(
creatorId: creatorId,
isAdultContentVisible: UserDefaults.isAdultContentVisible(),
contentType: ContentType(rawValue: UserDefaults.string(forKey: .contentPreference)) ?? ContentType.ALL
)
)
}
}