init: init proj
This commit is contained in:
22
DDYSClient/Models/ContentItem.swift
Normal file
22
DDYSClient/Models/ContentItem.swift
Normal file
@@ -0,0 +1,22 @@
|
||||
import Foundation
|
||||
|
||||
struct ContentItem: Identifiable, Hashable, Codable {
|
||||
let id: String // slug 作为 ID
|
||||
let title: String
|
||||
let year: Int
|
||||
let category: ContentCategory
|
||||
let rating: Double?
|
||||
let posterURL: URL?
|
||||
let badges: [String] // 新片/已完结/热门/推荐
|
||||
let onlineCount: Int
|
||||
let netdiskCount: Int
|
||||
let detailURL: String // 相对路径如 /movie/slug
|
||||
|
||||
static func == (lhs: ContentItem, rhs: ContentItem) -> Bool {
|
||||
lhs.id == rhs.id
|
||||
}
|
||||
|
||||
func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(id)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user