feat(content): 추천 오디오 탭을 추가한다
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import Foundation
|
||||
|
||||
struct AudioRecommendationsResponse: Decodable {
|
||||
let banners: [AudioBannerResponse]
|
||||
let originalSeries: [OriginalSeriesResponse]
|
||||
let latestAudios: [AudioCardResponse]
|
||||
let newAndHotAudios: [AudioCardResponse]
|
||||
let freeAudios: [AudioCardResponse]
|
||||
let pointAudios: [AudioCardResponse]
|
||||
let mostCommentedAudios: [CommentedAudioResponse]
|
||||
let recommendedAudios: [AudioCardResponse]
|
||||
|
||||
var isEmpty: Bool {
|
||||
banners.isEmpty &&
|
||||
originalSeries.isEmpty &&
|
||||
latestAudios.isEmpty &&
|
||||
newAndHotAudios.isEmpty &&
|
||||
freeAudios.isEmpty &&
|
||||
pointAudios.isEmpty &&
|
||||
mostCommentedAudios.isEmpty &&
|
||||
recommendedAudios.isEmpty
|
||||
}
|
||||
}
|
||||
|
||||
struct AudioBannerResponse: Decodable, Hashable, Identifiable {
|
||||
var id: String { "\(imageUrl)-\(creatorId ?? 0)-\(seriesId ?? 0)-\(link ?? "")" }
|
||||
|
||||
let imageUrl: String
|
||||
let eventItem: EventItem?
|
||||
let creatorId: Int?
|
||||
let seriesId: Int?
|
||||
let link: String?
|
||||
}
|
||||
|
||||
struct OriginalSeriesResponse: Decodable, Hashable, Identifiable {
|
||||
var id: Int { seriesId }
|
||||
|
||||
let seriesId: Int
|
||||
let coverImageUrl: String
|
||||
}
|
||||
|
||||
struct AudioCardResponse: Decodable, Hashable, Identifiable {
|
||||
var id: Int { audioContentId }
|
||||
|
||||
let audioContentId: Int
|
||||
let title: String
|
||||
let duration: String
|
||||
let imageUrl: String
|
||||
let price: Int
|
||||
let isAdult: Bool
|
||||
let isPointAvailable: Bool
|
||||
let isFirstContent: Bool
|
||||
let isOriginalSeries: Bool
|
||||
let creatorNickname: String
|
||||
}
|
||||
|
||||
struct CommentedAudioResponse: Decodable, Hashable, Identifiable {
|
||||
var id: Int { audioContentId }
|
||||
|
||||
let audioContentId: Int
|
||||
let title: String
|
||||
let imageUrl: String
|
||||
let latestComment: String
|
||||
let latestCommentWriterProfileImageUrl: String
|
||||
}
|
||||
Reference in New Issue
Block a user