시리즈 상세, 채널 상세

- 19금 콘텐츠 보기 설정 적용
This commit is contained in:
Yu Sung
2025-03-19 18:42:20 +09:00
parent 7dacc2d23a
commit 7c03ec8fd8
6 changed files with 69 additions and 20 deletions

View File

@@ -12,7 +12,7 @@ enum ExplorerApi {
case getCreatorRank
case getExplorer
case searchChannel(channel: String)
case getCreatorProfile(userId: Int)
case getCreatorProfile(userId: Int, isAdultContentVisible: Bool)
case getFollowerList(userId: Int, page: Int, size: Int)
case getCreatorProfileCheers(userId: Int, page: Int, size: Int)
case writeCheers(parentCheersId: Int?, creatorId: Int, content: String)
@@ -37,7 +37,7 @@ extension ExplorerApi: TargetType {
case .searchChannel:
return "/explorer/search/channel"
case .getCreatorProfile(let userId):
case .getCreatorProfile(let userId, _):
return "/explorer/profile/\(userId)"
case .getCreatorProfileDonationRanking(let userId, _, _):
@@ -81,8 +81,8 @@ extension ExplorerApi: TargetType {
case .searchChannel(let channel):
return .requestParameters(parameters: ["channel" : channel], encoding: URLEncoding.queryString)
case .getCreatorProfile:
let parameters = ["timezone": TimeZone.current.identifier] as [String: Any]
case .getCreatorProfile(_, let isAdultContentVisible):
let parameters = ["isAdultContentVisible": isAdultContentVisible, "timezone": TimeZone.current.identifier] as [String: Any]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
case .getFollowerList(_, let page, let size):

View File

@@ -22,7 +22,12 @@ final class ExplorerRepository {
}
func getCreatorProfile(id: Int) -> AnyPublisher<Response, MoyaError> {
return api.requestPublisher(.getCreatorProfile(userId: id))
return api.requestPublisher(
.getCreatorProfile(
userId: id,
isAdultContentVisible: UserDefaults.isAdultContentVisible()
)
)
}
func getFollowerList(userId: Int, page: Int, size: Int) -> AnyPublisher<Response, MoyaError> {