//
//  WA_3DModel.swift
//  wallpaper_project
//
//  Created by 忆海16 on 2024/3/11.
//

import UIKit
@objcMembers

class WA_3DModel: NSObject,Decodable,Encodable {
    
    var title:String?
    var thumbnail:String?
    var preview:String?
    var is_free:Int?
    var category:Int?
    var id:Int?
    var cnt_like:Int?

    enum CodingKeys: String, CodingKey {
           case title
           case thumbnail
           case preview
           case is_free
           case category
           case id
           case cnt_like
       }
       
       // 实现 Decodable 协议中的初始化方法
       required override init() {
           super.init()
       }
       
       // 实现 Encodable 协议中的编码方法
       func encode(to encoder: Encoder) throws {
           var container = encoder.container(keyedBy: CodingKeys.self)
           try container.encode(title, forKey: .title)
           try container.encode(thumbnail, forKey: .thumbnail)
           try container.encode(preview, forKey: .preview)
           try container.encode(is_free, forKey: .is_free)
           try container.encode(category, forKey: .category)
           try container.encode(id, forKey: .id)
           try container.encode(cnt_like, forKey: .cnt_like)
       }
    
}

