first commit

This commit is contained in:
JinJiangHuang
2026-03-01 14:04:44 +08:00
commit 61e97da938
62 changed files with 9947 additions and 0 deletions
+82
View File
@@ -0,0 +1,82 @@
import Foundation
/// / - Android Movie.java
struct Movie: Codable {
var videoList: [Video] = []
var pagecount: Int = 0
var page: Int = 0
var total: Int = 0
var limit: Int = 0
///
struct Video: Codable, Identifiable, Hashable {
var id: String
var name: String = ""
var pic: String = ""
var note: String = "" // "20"
var year: String = ""
var area: String = ""
var type: String = "" // /
var director: String = ""
var actor: String = ""
var des: String = "" //
var sourceKey: String = "" // key
var tid: String = "" // ID
var last: String = "" //
var dt: String = "" //
init(id: String = UUID().uuidString, name: String = "", pic: String = "",
note: String = "", sourceKey: String = "") {
self.id = id
self.name = name
self.pic = pic
self.note = note
self.sourceKey = sourceKey
}
enum CodingKeys: String, CodingKey {
case id = "vod_id"
case name = "vod_name"
case pic = "vod_pic"
case note = "vod_remarks"
case year = "vod_year"
case area = "vod_area"
case type = "type_name"
case director = "vod_director"
case actor = "vod_actor"
case des = "vod_content"
case tid = "type_id"
case last = "vod_time"
case dt = "vod_play_from"
case sourceKey
}
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
// String Int id
if let intId = try? container.decode(Int.self, forKey: .id) {
self.id = String(intId)
} else {
self.id = (try? container.decode(String.self, forKey: .id)) ?? UUID().uuidString
}
self.name = (try? container.decode(String.self, forKey: .name)) ?? ""
self.pic = (try? container.decode(String.self, forKey: .pic)) ?? ""
self.note = (try? container.decode(String.self, forKey: .note)) ?? ""
self.year = (try? container.decode(String.self, forKey: .year)) ?? ""
self.area = (try? container.decode(String.self, forKey: .area)) ?? ""
self.type = (try? container.decode(String.self, forKey: .type)) ?? ""
self.director = (try? container.decode(String.self, forKey: .director)) ?? ""
self.actor = (try? container.decode(String.self, forKey: .actor)) ?? ""
self.des = (try? container.decode(String.self, forKey: .des)) ?? ""
self.tid = {
if let intTid = try? container.decode(Int.self, forKey: .tid) {
return String(intTid)
}
return (try? container.decode(String.self, forKey: .tid)) ?? ""
}()
self.last = (try? container.decode(String.self, forKey: .last)) ?? ""
self.dt = (try? container.decode(String.self, forKey: .dt)) ?? ""
self.sourceKey = (try? container.decode(String.self, forKey: .sourceKey)) ?? ""
}
}
}