package com.fxy.login.bean;

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


/**
 * 登录用户对象
 *
 * @author James.Jiang
 * @date 2020-02-02
 */
public class UserBean implements Parcelable {

    public String name;
    public String dapartment;
    public String position;
    public String realName;
    public String enterpriseName;
    public String userId;
    public String avatarUrl;
    public String phone;
    public String user_token;
    public String eMail;
    public String weight_unit;
    public String url="";
    public String resource_type= "aliyun";
    public String resource_domain= "https://hcjfiles.oss-cn-hongkong.aliyuncs.com";
    public String resource_prefix= "dahuo";
    public String resource_region= "http://oss-cn-hongkong.aliyuncs.com";
    public String resource_bucket= "hcjfiles";
    public int business_type = 0;


    @Override
    public String toString() {
        return "UserBean{" +
                "name='" + name + '\'' +
                ", dapartment='" + dapartment + '\'' +
                ", position='" + position + '\'' +
                ", realName='" + realName + '\'' +
                ", enterpriseName='" + enterpriseName + '\'' +
                ", userId='" + userId + '\'' +
                ", avatarUrl='" + avatarUrl + '\'' +
                ", phone='" + phone + '\'' +
                ", user_token='" + user_token + '\'' +
                ", eMail='" + eMail + '\'' +
                ", weight_unit='" + weight_unit + '\'' +
                ", url='" + url + '\'' +
                ", resource_type='" + resource_type + '\'' +
                ", resource_domain='" + resource_domain + '\'' +
                ", resource_prefix='" + resource_prefix + '\'' +
                ", resource_region='" + resource_region + '\'' +
                ", resource_bucket='" + resource_bucket + '\'' +
                ", business_type=" + business_type +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeString(this.dapartment);
        dest.writeString(this.position);
        dest.writeString(this.realName);
        dest.writeString(this.enterpriseName);
        dest.writeString(this.userId);
        dest.writeString(this.avatarUrl);
        dest.writeString(this.phone);
        dest.writeString(this.user_token);
        dest.writeString(this.eMail);
        dest.writeString(this.weight_unit);
        dest.writeString(this.url);
        dest.writeString(this.resource_type);
        dest.writeString(this.resource_domain);
        dest.writeString(this.resource_prefix);
        dest.writeString(this.resource_region);
        dest.writeString(this.resource_bucket);
        dest.writeInt(this.business_type);
    }

    public void readFromParcel(Parcel source) {
        this.name = source.readString();
        this.dapartment = source.readString();
        this.position = source.readString();
        this.realName = source.readString();
        this.enterpriseName = source.readString();
        this.userId = source.readString();
        this.avatarUrl = source.readString();
        this.phone = source.readString();
        this.user_token = source.readString();
        this.eMail = source.readString();
        this.weight_unit = source.readString();
        this.url = source.readString();
        this.resource_type = source.readString();
        this.resource_domain = source.readString();
        this.resource_prefix = source.readString();
        this.resource_region = source.readString();
        this.resource_bucket = source.readString();
        this.business_type = source.readInt();
    }

    public UserBean() {
    }

    protected UserBean(Parcel in) {
        this.name = in.readString();
        this.dapartment = in.readString();
        this.position = in.readString();
        this.realName = in.readString();
        this.enterpriseName = in.readString();
        this.userId = in.readString();
        this.avatarUrl = in.readString();
        this.phone = in.readString();
        this.user_token = in.readString();
        this.eMail = in.readString();
        this.weight_unit = in.readString();
        this.url = in.readString();
        this.resource_type = in.readString();
        this.resource_domain = in.readString();
        this.resource_prefix = in.readString();
        this.resource_region = in.readString();
        this.resource_bucket = in.readString();
        this.business_type = in.readInt();
    }

    public static final Creator<UserBean> CREATOR = new Creator<UserBean>() {
        @Override
        public UserBean createFromParcel(Parcel source) {
            return new UserBean(source);
        }

        @Override
        public UserBean[] newArray(int size) {
            return new UserBean[size];
        }
    };


}
