package cn.muchinfo.rma.global.data

import android.os.Parcel
import android.os.Parcelable

/**
 * 通知公告
 * @property auditoruserid String?
 * @property auditremark String?
 * @property audittime String?
 * @property autoid String?
 * @property content String?
 * @property createtime String?
 * @property creatorid String?
 * @property endtime String?
 * @property istop String?
 * @property msgiconurl String?
 * @property msgtype String?
 * @property publisher String?
 * @property readed Boolean?
 * @property scheduletime String?
 * @property sendtype String?
 * @property sentstatus String?
 * @property title String?
 * @property userid String?
 * @constructor
 */
data class NoticeData(
    val auditoruserid : String? = "",//审核人
    val auditremark : String? = "",//审核备注
    val audittime : String? = "",//审核日期
    val autoid : String? = "",//自增ID
    val content : String? = "",//内容
    val createtime : String? = "",//创建时间
    val creatorid : String? = "",//建仓人
    val endtime : String? = "",//结束时间
    val istop : String? = "",//是否置顶 - 0:不置顶 1:置顶
    val msgiconurl : String? = "",//消息图标Url
    val msgtype : String? = "",//消息类型 - 1:公告通知 2:系统消息 3:商品到期提货通知
    val publisher : String? = "",//消息发布者
    val readed : Boolean? = false,//是否已读
    val scheduletime : String? = "",//计划发送时间
    val sendtype : String? = "",//推送方式 - 1：全体广播 2：按会员广播 3：个人推送 4:按会员广播(仅会员)
    val sentstatus : String? = "",//推送状态 - 0:未推送 1:已推送 2:审核拒绝
    val title : String? = "",//标题
    val userid : String? = ""//会员/投资者ID推送方式 为 个人时，填写投资者ID
) : Parcelable{
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readValue(Boolean::class.java.classLoader) as? Boolean,
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(auditoruserid)
        parcel.writeString(auditremark)
        parcel.writeString(audittime)
        parcel.writeString(autoid)
        parcel.writeString(content)
        parcel.writeString(createtime)
        parcel.writeString(creatorid)
        parcel.writeString(endtime)
        parcel.writeString(istop)
        parcel.writeString(msgiconurl)
        parcel.writeString(msgtype)
        parcel.writeString(publisher)
        parcel.writeValue(readed)
        parcel.writeString(scheduletime)
        parcel.writeString(sendtype)
        parcel.writeString(sentstatus)
        parcel.writeString(title)
        parcel.writeString(userid)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<NoticeData> {
        override fun createFromParcel(parcel: Parcel): NoticeData {
            return NoticeData(parcel)
        }

        override fun newArray(size: Int): Array<NoticeData?> {
            return arrayOfNulls(size)
        }
    }

}