Newer
Older
Meterage_iOS / Meterage / Model / NoticeListModel.swift
//
//  NoticeListModel.swift
//  Meterage
//
//  Created by 203 on 2023/2/3.
//

import Foundation
import SwiftyJSON

struct NoticeListModel {
    var code: Int
    var data: NoticeModel
    var message: String

    init(respJson: JSON) {
        code = respJson["code"].intValue
        message = respJson["message"].stringValue
        data = NoticeModel(respJson: respJson["data"])
    }
}

struct NoticeModel{
    var total: Int
    var rows: [RowModel]

    init(respJson: JSON) {
        total = respJson["total"].intValue
        rows = [RowModel]()
        let rowsArray = respJson["rows"].arrayValue
        for rowsJson in rowsArray {
            let value = RowModel(respJson: rowsJson)
            rows.append(value)
        }
    }
}

struct RowModel {
    var createTime: String?
    var id: String?
    var isDel: Int?
    var minioFileName: String?
    var noticeCompany: String?
    var noticeContent: String?
    var noticeNo: String?
    var noticePublisher: String?
    var noticeSketch: String?
    var noticeTime: String?
    var noticeTitle: String?
    var updateTime: String?

    init() {
    }

    init(respJson: JSON) {
        createTime = respJson["createTime"].stringValue
        id = respJson["id"].stringValue
        isDel = respJson["isDel"].intValue
        minioFileName = respJson["minioFileName"].stringValue
        noticeCompany = respJson["noticeCompany"].stringValue
        noticeContent = respJson["noticeContent"].stringValue
        noticeNo = respJson["noticeNo"].stringValue
        noticePublisher = respJson["noticePublisher"].stringValue
        noticeSketch = respJson["noticeSketch"].stringValue
        noticeTime = respJson["noticeTime"].stringValue
        noticeTitle = respJson["noticeTitle"].stringValue
        updateTime = respJson["updateTime"].stringValue
    }
}