OOConfigInfoModels.swift 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. //
  2. // OOConfigInfoModels.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2018/4/25.
  6. // Copyright © 2018年 zoneland. All rights reserved.
  7. //
  8. import Foundation
  9. import HandyJSON
  10. // MARK:- OOConfigInfo
  11. public class OOConfigInfo:NSObject,DataModel,NSCoding {
  12. @objc var images : [OOConfigImage]?
  13. @objc var indexPortal : String?
  14. @objc var indexType : String?
  15. @objc var nativeAppList : [OONativeApp]?
  16. @objc var portalList : [OOPortalInfo]?
  17. required public override init() {
  18. }
  19. public func encode(with aCoder: NSCoder) {
  20. if images != nil {
  21. aCoder.encode(images, forKey: "images")
  22. }
  23. if indexPortal != nil {
  24. aCoder.encode(indexPortal, forKey: "indexPortal")
  25. }
  26. if indexType != nil {
  27. aCoder.encode(indexType, forKey: "indexType")
  28. }
  29. if nativeAppList != nil {
  30. aCoder.encode(nativeAppList, forKey: "nativeAppList")
  31. }
  32. if portalList != nil {
  33. aCoder.encode(portalList, forKey: "portalList")
  34. }
  35. }
  36. public required init?(coder aDecoder: NSCoder) {
  37. images = aDecoder.decodeObject(forKey: "images") as? [OOConfigImage]
  38. indexPortal = aDecoder.decodeObject(forKey: "indexPortal") as? String
  39. indexType = aDecoder.decodeObject(forKey: "indexType") as? String
  40. nativeAppList = aDecoder.decodeObject(forKey: "nativeAppList") as? [OONativeApp]
  41. portalList = aDecoder.decodeObject(forKey: "portalList") as? [OOPortalInfo]
  42. }
  43. public override var description: String {
  44. return "OOConfigInfo"
  45. }
  46. }
  47. // MARK:- OOPortalInfo
  48. public class OOPortalInfo:NSObject,DataModel,NSCoding {
  49. @objc var alias : String?
  50. @objc var createTime : String?
  51. @objc var creatorPerson : String?
  52. @objc var descriptionField : String?
  53. var enable : Bool?
  54. @objc var firstPage : String?
  55. @objc var id : String?
  56. @objc var lastUpdatePerson : String?
  57. @objc var lastUpdateTime : String?
  58. @objc var name : String?
  59. @objc var portalCategory : String?
  60. @objc var updateTime : String?
  61. required public override init() {
  62. }
  63. public func encode(with aCoder: NSCoder) {
  64. if alias != nil {
  65. aCoder.encode(alias, forKey: "alias")
  66. }
  67. if createTime != nil {
  68. aCoder.encode(createTime, forKey: "createTime")
  69. }
  70. if creatorPerson != nil {
  71. aCoder.encode(creatorPerson, forKey: "creatorPerson")
  72. }
  73. if descriptionField != nil {
  74. aCoder.encode(descriptionField, forKey: "descriptionField")
  75. }
  76. if enable != nil {
  77. aCoder.encode(enable, forKey: "enable")
  78. }
  79. if firstPage != nil {
  80. aCoder.encode(firstPage, forKey: "firstPage")
  81. }
  82. if id != nil {
  83. aCoder.encode(id, forKey: "id")
  84. }
  85. if lastUpdatePerson != nil {
  86. aCoder.encode(lastUpdatePerson, forKey: "lastUpdatePerson")
  87. }
  88. if lastUpdateTime != nil {
  89. aCoder.encode(lastUpdateTime, forKey: "lastUpdateTime")
  90. }
  91. if name != nil {
  92. aCoder.encode(name, forKey: "name")
  93. }
  94. if portalCategory != nil {
  95. aCoder.encode(portalCategory, forKey: "portalCategory")
  96. }
  97. if updateTime != nil {
  98. aCoder.encode(updateTime, forKey: "updateTime")
  99. }
  100. }
  101. public required init?(coder aDecoder: NSCoder) {
  102. alias = aDecoder.decodeObject(forKey: "alias") as? String
  103. createTime = aDecoder.decodeObject(forKey: "createTime") as? String
  104. creatorPerson = aDecoder.decodeObject(forKey: "creatorPerson") as? String
  105. descriptionField = aDecoder.decodeObject(forKey: "descriptionField") as? String
  106. alias = aDecoder.decodeObject(forKey: "alias") as? String
  107. enable = aDecoder.decodeObject(forKey: "enable") as? Bool
  108. firstPage = aDecoder.decodeObject(forKey: "firstPage") as? String
  109. id = aDecoder.decodeObject(forKey: "id") as? String
  110. lastUpdatePerson = aDecoder.decodeObject(forKey: "lastUpdatePerson") as? String
  111. lastUpdateTime = aDecoder.decodeObject(forKey: "lastUpdateTime") as? String
  112. name = aDecoder.decodeObject(forKey: "name") as? String
  113. portalCategory = aDecoder.decodeObject(forKey: "portalCategory") as? String
  114. updateTime = aDecoder.decodeObject(forKey: "updateTime") as? String
  115. }
  116. public override var description: String {
  117. return "OOPortalInfo"
  118. }
  119. }
  120. // MARK:- OONativeApp
  121. public class OONativeApp:NSObject,DataModel,NSCoding {
  122. var enable : Bool?
  123. @objc var iOS : OOiOS?
  124. var id : Int?
  125. @objc var key : String?
  126. @objc var name : String?
  127. required public override init() {
  128. }
  129. public func encode(with aCoder: NSCoder) {
  130. if enable != nil {
  131. aCoder.encode(enable, forKey: "enable")
  132. }
  133. if iOS != nil {
  134. aCoder.encode(iOS, forKey: "iOS")
  135. }
  136. if id != nil {
  137. aCoder.encode(id, forKey: "id")
  138. }
  139. if key != nil {
  140. aCoder.encode(key, forKey: "key")
  141. }
  142. if name != nil {
  143. aCoder.encode(name, forKey: "name")
  144. }
  145. }
  146. public required init?(coder aDecoder: NSCoder) {
  147. enable = aDecoder.decodeObject(forKey: "enable") as? Bool
  148. iOS = aDecoder.decodeObject(forKey: "iOS") as? OOiOS
  149. id = aDecoder.decodeObject(forKey: "id") as? Int
  150. key = aDecoder.decodeObject(forKey: "key") as? String
  151. name = aDecoder.decodeObject(forKey: "name") as? String
  152. }
  153. public override var description: String {
  154. return ""
  155. }
  156. }
  157. // MARK:- OOiOS
  158. public class OOiOS:NSObject,DataModel,NSCoding {
  159. @objc var category : String?
  160. @objc var storyboard : String?
  161. @objc var subcategory : String?
  162. @objc var vcname : String?
  163. required public override init() {
  164. }
  165. public func encode(with aCoder: NSCoder) {
  166. if category != nil {
  167. aCoder.encode(category, forKey: "category")
  168. }
  169. if storyboard != nil {
  170. aCoder.encode(storyboard, forKey: "storyboard")
  171. }
  172. if subcategory != nil {
  173. aCoder.encode(subcategory, forKey: "subcategory")
  174. }
  175. if vcname != nil {
  176. aCoder.encode(vcname, forKey: "vcname")
  177. }
  178. }
  179. public required init?(coder aDecoder: NSCoder) {
  180. category = aDecoder.decodeObject(forKey: "category") as? String
  181. storyboard = aDecoder.decodeObject(forKey: "storyboard") as? String
  182. subcategory = aDecoder.decodeObject(forKey: "subcategory") as? String
  183. vcname = aDecoder.decodeObject(forKey: "vcname") as? String
  184. }
  185. public override var description: String {
  186. return "OOiOS"
  187. }
  188. }
  189. // MARK:- OOConfigImage
  190. public class OOConfigImage:NSObject,DataModel,NSCoding {
  191. @objc var name : String?
  192. @objc var value : String?
  193. public required init?(coder aDecoder: NSCoder) {
  194. name = aDecoder.decodeObject(forKey: "name") as? String
  195. value = aDecoder.decodeObject(forKey: "value") as? String
  196. }
  197. required public override init() {
  198. }
  199. public func encode(with aCoder: NSCoder) {
  200. if name != nil {
  201. aCoder.encode(name, forKey: "name")
  202. }
  203. if value != nil {
  204. aCoder.encode(value, forKey: "value")
  205. }
  206. }
  207. public override var description: String {
  208. return "OOConfigImage"
  209. }
  210. }