package com.bc_chat.bc_base.entity.group

import android.os.Parcel
import android.os.Parcelable
import com.google.gson.annotations.SerializedName

/**
 * author：Created by zhaohaoting on 2019/3/7
 * email：526309416@qq.com
 * desc：
 */
class Group() :Parcelable {
   @SerializedName("id")
    var groupId: String? = ""
    var group_name: String? = ""
    var photo: String? = ""
    @SerializedName("end_time")
    var endTime: String? = "0"
    var introduction: String? = null// "这是群介绍哦",//群简介
    var notice: String? = null//群公告
    var type: Int? = 1//  "2", //1-开 2-关闭1小时 3-关闭8小时 4-关闭2天 5-关闭（提示：为null时即表示尚未初次设置，为默认值）
    var is_top: String? = "0"//  是否置顶  1 置顶
    var is_banned: String? = "0"//是否禁言  1 禁言
    var isInGroup: String? = "0"//是否在群里面  1 是

    constructor(parcel: Parcel) : this() {
        groupId = parcel.readString()
        group_name = parcel.readString()
        photo = parcel.readString()
        endTime = parcel.readString()
        introduction = parcel.readString()
        notice = parcel.readString()
        type = parcel.readValue(Int::class.java.classLoader) as? Int
        is_top = parcel.readString()
        is_banned = parcel.readString()
        isInGroup = parcel.readString()
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(groupId)
        parcel.writeString(group_name)
        parcel.writeString(photo)
        parcel.writeString(endTime)
        parcel.writeString(introduction)
        parcel.writeString(notice)
        parcel.writeValue(type)
        parcel.writeString(is_top)
        parcel.writeString(is_banned)
        parcel.writeString(isInGroup)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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