You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
struct BookResource: Convertible {
enum ResourceType {
case picture
case pictureFllowRead
case video
case audio
case demo
case test
case weike
case unkown
}
let rID: Int = 0
let rName: String = ""
let ext: String = ""
let showNum: Int = 0
let fileType: Int = 0
let chapterID: Int = 9991
let sectionID: Int = 0
let downloadPath: String = ""
let ossName: String = ""
let picOption: Int = 0
let imgType: Int = 0
let fundamentalTone: String = ""
var type: ResourceType {
switch picOption {
case 1:
if imgType == 1 {
return .pictureFllowRead
}
else {
return .picture
}
case 2:
return .demo
case 3:
return .test
case 4:
return .video
case 5:
return .audio
case 6:
return .weike
default:
return .unkown
}
}
func kj_modelKey(from property: Property) -> ModelPropertyKey {
switch property.name {
case "rID": return "r_id"
case "rName": return "r_name"
case "showNum": return "show_num"
case "chapterID": return "chapter_id"
case "sectionID": return "section_id"
case "imgType": return "img_type"
case "fundamentalTone": return "fundamental_tone"
default:
return property.name
}
}
}
模型
在这里用的, 我把打印复制到里边了
控制台, 可以把值 po 出来
(lldb) po resource.rID
984
(lldb) po resourceID
0
chapterID, 在使用的时候就是默认值 9991
let chapterID: Int = 9991
The text was updated successfully, but these errors were encountered: