|
@@ -0,0 +1,203 @@
|
|
|
+//
|
|
|
+// CMSModel.swift
|
|
|
+// Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
|
|
|
+
|
|
|
+import Foundation
|
|
|
+import ObjectMapper
|
|
|
+
|
|
|
+
|
|
|
+class CMSModel : NSObject, NSCoding, Mappable{
|
|
|
+
|
|
|
+ var applyType : String?
|
|
|
+ var content : [CMSContentModel]?
|
|
|
+ var title : String?
|
|
|
+
|
|
|
+
|
|
|
+ class func newInstance(map: Map) -> Mappable?{
|
|
|
+ return CMSModel()
|
|
|
+ }
|
|
|
+ required init?(map: Map){}
|
|
|
+ private override init(){}
|
|
|
+
|
|
|
+ func mapping(map: Map)
|
|
|
+ {
|
|
|
+ applyType <- map["apply_type"]
|
|
|
+ content <- map["content"]
|
|
|
+ title <- map["title"]
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * NSCoding required initializer.
|
|
|
+ * Fills the data from the passed decoder
|
|
|
+ */
|
|
|
+ @objc required init(coder aDecoder: NSCoder)
|
|
|
+ {
|
|
|
+ applyType = aDecoder.decodeObject(forKey: "apply_type") as? String
|
|
|
+ content = aDecoder.decodeObject(forKey: "content") as? [CMSContentModel]
|
|
|
+ title = aDecoder.decodeObject(forKey: "title") as? String
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * NSCoding required method.
|
|
|
+ * Encodes mode properties into the decoder
|
|
|
+ */
|
|
|
+ @objc func encode(with aCoder: NSCoder)
|
|
|
+ {
|
|
|
+ if applyType != nil{
|
|
|
+ aCoder.encode(applyType, forKey: "apply_type")
|
|
|
+ }
|
|
|
+ if content != nil{
|
|
|
+ aCoder.encode(content, forKey: "content")
|
|
|
+ }
|
|
|
+ if title != nil{
|
|
|
+ aCoder.encode(title, forKey: "title")
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+class CMSContentModel : NSObject, NSCoding, Mappable{
|
|
|
+
|
|
|
+ var areaType : String?
|
|
|
+ var rule : [CMSRuleModel]?
|
|
|
+
|
|
|
+
|
|
|
+ class func newInstance(map: Map) -> Mappable?{
|
|
|
+ return CMSContentModel()
|
|
|
+ }
|
|
|
+ required init?(map: Map){}
|
|
|
+ private override init(){}
|
|
|
+
|
|
|
+ func mapping(map: Map)
|
|
|
+ {
|
|
|
+ areaType <- map["area_type"]
|
|
|
+ rule <- map["rule"]
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * NSCoding required initializer.
|
|
|
+ * Fills the data from the passed decoder
|
|
|
+ */
|
|
|
+ @objc required init(coder aDecoder: NSCoder)
|
|
|
+ {
|
|
|
+ areaType = aDecoder.decodeObject(forKey: "area_type") as? String
|
|
|
+ rule = aDecoder.decodeObject(forKey: "rule") as? [CMSRuleModel]
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * NSCoding required method.
|
|
|
+ * Encodes mode properties into the decoder
|
|
|
+ */
|
|
|
+ @objc func encode(with aCoder: NSCoder)
|
|
|
+ {
|
|
|
+ if areaType != nil{
|
|
|
+ aCoder.encode(areaType, forKey: "area_type")
|
|
|
+ }
|
|
|
+ if rule != nil{
|
|
|
+ aCoder.encode(rule, forKey: "rule")
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+class CMSRuleModel : NSObject, NSCoding, Mappable{
|
|
|
+
|
|
|
+ var linkType : String?
|
|
|
+ var linkUrl : String?
|
|
|
+ var showNum : Int?
|
|
|
+ var title : String?
|
|
|
+ var url : String?
|
|
|
+ var id : Int?
|
|
|
+ var productId : String?
|
|
|
+ var rule : CMSRuleModel?
|
|
|
+ var showType : Int?
|
|
|
+ var subjectId : String?
|
|
|
+
|
|
|
+
|
|
|
+ class func newInstance(map: Map) -> Mappable?{
|
|
|
+ return CMSRuleModel()
|
|
|
+ }
|
|
|
+ required init?(map: Map){}
|
|
|
+ private override init(){}
|
|
|
+
|
|
|
+ func mapping(map: Map)
|
|
|
+ {
|
|
|
+ linkType <- map["link_type"]
|
|
|
+ linkUrl <- map["link_url"]
|
|
|
+ showNum <- map["show_num"]
|
|
|
+ title <- map["title"]
|
|
|
+ url <- map["url"]
|
|
|
+ id <- map["id"]
|
|
|
+ productId <- map["product_id"]
|
|
|
+ rule <- map["rule"]
|
|
|
+ showType <- map["show_type"]
|
|
|
+ subjectId <- map["subject_id"]
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * NSCoding required initializer.
|
|
|
+ * Fills the data from the passed decoder
|
|
|
+ */
|
|
|
+ @objc required init(coder aDecoder: NSCoder)
|
|
|
+ {
|
|
|
+ linkType = aDecoder.decodeObject(forKey: "link_type") as? String
|
|
|
+ linkUrl = aDecoder.decodeObject(forKey: "link_url") as? String
|
|
|
+ showNum = aDecoder.decodeObject(forKey: "show_num") as? Int
|
|
|
+ title = aDecoder.decodeObject(forKey: "title") as? String
|
|
|
+ url = aDecoder.decodeObject(forKey: "url") as? String
|
|
|
+ id = aDecoder.decodeObject(forKey: "id") as? Int
|
|
|
+ productId = aDecoder.decodeObject(forKey: "product_id") as? String
|
|
|
+ rule = aDecoder.decodeObject(forKey: "rule") as? CMSRuleModel
|
|
|
+ showType = aDecoder.decodeObject(forKey: "show_type") as? Int
|
|
|
+ subjectId = aDecoder.decodeObject(forKey: "subject_id") as? String
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * NSCoding required method.
|
|
|
+ * Encodes mode properties into the decoder
|
|
|
+ */
|
|
|
+ @objc func encode(with aCoder: NSCoder)
|
|
|
+ {
|
|
|
+ if linkType != nil{
|
|
|
+ aCoder.encode(linkType, forKey: "link_type")
|
|
|
+ }
|
|
|
+ if linkUrl != nil{
|
|
|
+ aCoder.encode(linkUrl, forKey: "link_url")
|
|
|
+ }
|
|
|
+ if showNum != nil{
|
|
|
+ aCoder.encode(showNum, forKey: "show_num")
|
|
|
+ }
|
|
|
+ if title != nil{
|
|
|
+ aCoder.encode(title, forKey: "title")
|
|
|
+ }
|
|
|
+ if url != nil{
|
|
|
+ aCoder.encode(url, forKey: "url")
|
|
|
+ }
|
|
|
+ if id != nil{
|
|
|
+ aCoder.encode(id, forKey: "id")
|
|
|
+ }
|
|
|
+ if productId != nil{
|
|
|
+ aCoder.encode(productId, forKey: "product_id")
|
|
|
+ }
|
|
|
+ if rule != nil{
|
|
|
+ aCoder.encode(rule, forKey: "rule")
|
|
|
+ }
|
|
|
+ if showType != nil{
|
|
|
+ aCoder.encode(showType, forKey: "show_type")
|
|
|
+ }
|
|
|
+ if subjectId != nil{
|
|
|
+ aCoder.encode(subjectId, forKey: "subject_id")
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|