CNLiveMineBaseModel.swift
6.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
//
// CNLiveMineBaseModel.swift
// metaCode
//
// Created by open on 2023/6/20.
//
import Foundation
import HandyJSON
class UpdateInfoModel: BaseModel {
required init() {}
var id:String = ""
var appId:String = ""
var appType:String = ""
var version:String = ""
var versionCode:String = ""
var isForce:Bool = false//是不是强制更新
var apkUrl:String = ""
var upgradePoint:String = ""
var status:String = ""
var createTime:String = ""
/**
/api/identityApi/list
接口的数据 id createTime为公共参数
*/
var name:String = ""
var icon:String = ""
var enable:String = ""
}
class NewsModel: BaseModel {
required init() {}
var prePage: Int = 0
var pageSize: Int = 0
var startRow: Int = 0
var navigateLastPage: Int = 0
var firstPage: Int = 0
var nextPage: Int = 0
var size: Int = 0
var endRow: Int = 0
var isLastPage: Bool = false
var hasNextPage: Bool = false
var navigateFirstPage: Int = 0
var lastPage: Int = 0
var total: Int = 0
var list = [NewsListModel]()
var navigatepageNums = [Int]()
var isFirstPage: Bool = false
var hasPreviousPage: Bool = false
var navigatePages: Int = 0
var pageNum: Int = 0
var pages: Int = 0
}
class NewsListModel: BaseModel {
var content: String = ""
var status: Int = 0
var id: Int = 0
var poster: String = ""
var title: String = ""
var sid: String = ""
var createTime: Int = 0
var createTimeString: String = ""
var timeString: String = ""
var subTitle: String = ""
var read: Bool = false
var textHeight: CGFloat {
get {
let paraph = NSMutableParagraphStyle()
paraph.lineSpacing = 10
let attributes = [NSAttributedString.Key.font:Font_16_Fit,
NSAttributedString.Key.paragraphStyle: paraph]
let h = content.boundingRect(with: CGSize(width: KSreenWidth - 110, height: CGFloat(MAXFLOAT)), options: .usesLineFragmentOrigin, attributes: attributes, context: nil).size.height
return h
}
}
override func mapping(mapper: HelpingMapper) {
mapper <<<
self.createTime <-- TransformOf(fromJSON: { [weak self] (raw) -> Int in
if (raw ?? 0)! > 0 {
let date = NSDate(timeIntervalSince1970: TimeInterval((raw!)/1000))
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale.init(identifier: "zh_CN")
dateFormatter.dateFormat = "MM-dd"
self?.createTimeString = dateFormatter.string(from: date as Date)
let dateFormatter_time = DateFormatter()
dateFormatter_time.locale = Locale.init(identifier: "zh_CN")
dateFormatter_time.dateFormat = "yyyy年MM月dd日 HH:mm"
self?.timeString = dateFormatter_time.string(from: date as Date)
}
return raw!
}, toJSON: { (tuple) -> Int? in
return tuple
})
// mapper <<<
// self.content <-- TransformOf(fromJSON: { result -> String in
// return result! + "金正恩和老兵有说有笑,欣赏着精彩绝伦的烟花表演,一起憧憬朝鲜走向繁荣富强。金正恩最后面向全体朝鲜老兵进行90度的鞠躬,再次对他们表达深深的尊重和感激。他没有忘记为国家立下汗马功劳的朝鲜老兵,更没有忘记老一辈。"
// }, toJSON: { result -> String? in
// return result
// })
}
}
class StandListBaseModel: BaseModel {
var prePage: Int = 0
var pageSize: Int = 0
var startRow: Int = 0
var navigateLastPage: Int = 0
var firstPage: Int = 0
var nextPage: Int = 0
var size: Int = 0
var endRow: Int = 0
var isLastPage: Bool = false
var hasNextPage: Bool = false
var navigateFirstPage: Int = 0
var lastPage: Int = 0
var total: Int = 0
var list = [StandListModel]()
var navigatepageNums = [Int]()
var isFirstPage: Bool = false
var hasPreviousPage: Bool = false
var navigatePages: Int = 0
var pageNum: Int = 0
var pages: Int = 0
}
class StandListModel: BaseModel {
var icon: String?
var name: String?
var enable: Bool = false
var id: Int = 0
var createTime: Int = 0
var createTimeString: String = ""
var timeString: String = ""
var auth: Bool = false
override func mapping(mapper: HelpingMapper) {
mapper <<<
self.createTime <-- TransformOf(fromJSON: { [weak self] (raw) -> Int in
if (raw ?? 0)! > 0 {
let date = NSDate(timeIntervalSince1970: TimeInterval((raw!)/1000))
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale.init(identifier: "zh_CN")
dateFormatter.dateFormat = "MM-dd"
self?.createTimeString = dateFormatter.string(from: date as Date)
let dateFormatter_time = DateFormatter()
dateFormatter_time.locale = Locale.init(identifier: "zh_CN")
dateFormatter_time.dateFormat = "yyyy年MM月dd日 HH:mm"
self?.timeString = dateFormatter_time.string(from: date as Date)
}
return raw!
}, toJSON: { (tuple) -> Int? in
return tuple
})
}
}
class MineStandInfoBaseModel: BaseModel {
var authInfos = [MineStandInfoModel]()
var icon: String?
var name: String?
var identityId: Int = 0
}
class MineStandInfoModel: BaseModel {
var authInfoId: Int = 0
var name: String?
var inputType: Int = 0//1 文本输入 2数字输入 3下拉选择 4后台生成时间 5后台生成编码
var sort: Int = 0
var nonEmpty: Bool = false
var input: Bool = false
var show: Bool = false
var value: String? = ""//自己定义的值
var children = [MineStandInfoModel]()
}