fix(content): 성인 콘텐츠 설정 동기화와 국가별 인증 분기를 적용한다
This commit is contained in:
@@ -23,4 +23,55 @@ struct GetMemberInfoResponse: Decodable {
|
||||
let followingChannelLiveNotice: Bool?
|
||||
let followingChannelUploadContentNotice: Bool?
|
||||
let auditionNotice: Bool?
|
||||
let countryCode: String
|
||||
let isAdultContentVisible: Bool
|
||||
let contentType: String
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case can
|
||||
case point
|
||||
case isAuth
|
||||
case gender
|
||||
case signupDate
|
||||
case chargeCount
|
||||
case role
|
||||
case messageNotice
|
||||
case followingChannelLiveNotice
|
||||
case followingChannelUploadContentNotice
|
||||
case auditionNotice
|
||||
case countryCode
|
||||
case isAdultContentVisible
|
||||
case contentType
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
|
||||
can = try container.decode(Int.self, forKey: .can)
|
||||
point = try container.decode(Int.self, forKey: .point)
|
||||
isAuth = try container.decode(Bool.self, forKey: .isAuth)
|
||||
gender = try container.decodeIfPresent(String.self, forKey: .gender)
|
||||
signupDate = try container.decode(String.self, forKey: .signupDate)
|
||||
chargeCount = try container.decode(Int.self, forKey: .chargeCount)
|
||||
role = try container.decode(MemberRole.self, forKey: .role)
|
||||
messageNotice = try container.decodeIfPresent(Bool.self, forKey: .messageNotice)
|
||||
followingChannelLiveNotice = try container.decodeIfPresent(Bool.self, forKey: .followingChannelLiveNotice)
|
||||
followingChannelUploadContentNotice = try container.decodeIfPresent(Bool.self, forKey: .followingChannelUploadContentNotice)
|
||||
auditionNotice = try container.decodeIfPresent(Bool.self, forKey: .auditionNotice)
|
||||
|
||||
countryCode =
|
||||
try container
|
||||
.decodeIfPresent(String.self, forKey: .countryCode)?
|
||||
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
.uppercased() ?? ""
|
||||
|
||||
isAdultContentVisible = try container.decodeIfPresent(Bool.self, forKey: .isAdultContentVisible) ?? true
|
||||
|
||||
let rawContentType =
|
||||
try container
|
||||
.decodeIfPresent(String.self, forKey: .contentType)?
|
||||
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
.uppercased()
|
||||
contentType = ["ALL", "MALE", "FEMALE"].contains(rawContentType ?? "") ? (rawContentType ?? "ALL") : "ALL"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user