diff --git a/SodaLive/Sources/V2/CreatorChannel/CreatorChannelViewModel.swift b/SodaLive/Sources/V2/CreatorChannel/CreatorChannelViewModel.swift index e631a2dc..e8975426 100644 --- a/SodaLive/Sources/V2/CreatorChannel/CreatorChannelViewModel.swift +++ b/SodaLive/Sources/V2/CreatorChannel/CreatorChannelViewModel.swift @@ -33,6 +33,10 @@ final class CreatorChannelViewModel: ObservableObject { guard let self else { return } do { + if let jsonString = String(data: response.data, encoding: .utf8) { + DEBUG_LOG("CreatorChannelHome raw response: \(jsonString)") + } + let jsonDecoder = JSONDecoder() let decoded = try jsonDecoder.decode(ApiResponse.self, from: response.data) @@ -48,6 +52,7 @@ final class CreatorChannelViewModel: ObservableObject { } } catch { ERROR_LOG(error.localizedDescription) + print(error) self.applyApiFailedPlaceholderState() } diff --git a/SodaLive/Sources/V2/CreatorChannel/Home/Models/CreatorChannelHomeResponse.swift b/SodaLive/Sources/V2/CreatorChannel/Home/Models/CreatorChannelHomeResponse.swift index 03bddd0b..8a071a86 100644 --- a/SodaLive/Sources/V2/CreatorChannel/Home/Models/CreatorChannelHomeResponse.swift +++ b/SodaLive/Sources/V2/CreatorChannel/Home/Models/CreatorChannelHomeResponse.swift @@ -18,14 +18,14 @@ struct CreatorChannelHomeResponse: Decodable { struct CreatorChannelCreatorResponse: Decodable, Identifiable { let creatorId: Int - let nickname: String - let profileImageUrl: String? - let followerCount: Int let characterId: Int? - var isFollow: Bool - var isNotify: Bool + let nickname: String + let profileImageUrl: String + let followerCount: Int let isAiChatAvailable: Bool let isDmAvailable: Bool + var isFollow: Bool + var isNotify: Bool var id: Int { creatorId } } @@ -44,43 +44,39 @@ struct CreatorChannelLiveResponse: Decodable, Identifiable { struct CreatorChannelAudioContentResponse: Decodable, Identifiable { let audioContentId: Int let title: String - let duration: Int + let duration: String? let imageUrl: String? let price: Int let isAdult: Bool let isPointAvailable: Bool let isFirstContent: Bool let seriesName: String? - let isOriginalSeries: Bool + let isOriginalSeries: Bool? + let isOwned: Bool + let isRented: Bool var id: Int { audioContentId } } -struct CreatorChannelDonationResponse: Decodable, Identifiable { - let donationId: Int +struct CreatorChannelDonationResponse: Decodable { let nickname: String - let profileImageUrl: String? + let profileImageUrl: String let can: Int let message: String let createdAtUtc: String - - var id: Int { donationId } } -struct CreatorChannelScheduleResponse: Decodable, Identifiable { - let scheduleId: String +struct CreatorChannelScheduleResponse: Decodable { let scheduledAtUtc: String let title: String let type: CreatorActivityType let targetId: Int - - var id: String { scheduleId } } struct CreatorChannelSeriesResponse: Decodable, Identifiable { let seriesId: Int let title: String - let coverImageUrl: String? + let coverImageUrl: String let numberOfContent: Int let isNew: Bool let isOriginal: Bool @@ -92,15 +88,16 @@ struct CreatorChannelCommunityPostResponse: Decodable, Identifiable { let postId: Int let creatorId: Int let creatorNickname: String - let creatorProfileImageUrl: String? - let content: String + let creatorProfileUrl: String let imageUrl: String? let audioUrl: String? + let content: String let price: Int + let dateUtc: String let existOrdered: Bool let likeCount: Int let commentCount: Int - let createdAtUtc: String + let isLiked: Bool var id: Int { postId } } @@ -112,18 +109,19 @@ struct CreatorChannelFanTalkSummaryResponse: Decodable { struct CreatorChannelFanTalkResponse: Decodable, Identifiable { let fanTalkId: Int + let memberId: Int let nickname: String - let profileImageUrl: String? + let profileImageUrl: String let content: String - let languageCode: String + let languageCode: String? let createdAtUtc: String var id: Int { fanTalkId } } struct CreatorChannelActivityResponse: Decodable { - let debutDateUtc: String - let dDay: Int + let debutDateUtc: String? + let dday: String let liveCount: Int let liveDurationHours: Int let liveContributorCount: Int @@ -132,9 +130,9 @@ struct CreatorChannelActivityResponse: Decodable { } struct CreatorChannelSnsResponse: Decodable { - let instagramUrl: String? - let youtubeUrl: String? - let xUrl: String? - let kakaoOpenChatUrl: String? - let fancimmUrl: String? + let instagramUrl: String + let fancimmUrl: String + let xurl: String + let youtubeUrl: String + let kakaoOpenChatUrl: String }