package com.phlx.anchorcollect.entity;

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

import androidx.annotation.Size;
import androidx.databinding.BaseObservable;

import org.greenrobot.greendao.annotation.Entity;

import java.util.Arrays;
import java.util.List;
import org.greenrobot.greendao.annotation.Generated;


/**
 * 角色表 sys_role
 *
 * @author ruoyi
 */
@Entity
public class UserRoleEntity extends BaseObservable implements Parcelable {
    private static final long serialVersionUID = 1L;

    /**
     * 角色ID
     */
    private String roleId;

    /**
     * 角色名称
     */
    private String roleName;

    /**
     * 角色权限
     */
    private String roleKey;

    /**
     * 角色排序
     */
    private String roleSort;

    /**
     * 数据范围（1：所有数据权限；2：自定义数据权限；3：本部门数据权限；4：本部门及以下数据权限；5：仅本人数据权限）
     */
    private String dataScope;

    /**
     * 角色状态（0正常 1停用）
     */
    private String status;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    private String delFlag;

    /**
     * 用户是否存在此角色标识 默认不存在
     */
    private boolean flag = false;

    /**
     * 菜单组
     */
//    private List<String> menuIds;

    /**
     * 部门组（数据权限）
     */
//    private List<String> deptIds;

    public UserRoleEntity() {

    }

    protected UserRoleEntity(Parcel in) {
        roleId = in.readString();
        roleName = in.readString();
        roleKey = in.readString();
        roleSort = in.readString();
        dataScope = in.readString();
        status = in.readString();
        delFlag = in.readString();
        flag = in.readByte() != 0;
    }

    @Generated(hash = 143809690)
    public UserRoleEntity(String roleId, String roleName, String roleKey, String roleSort,
            String dataScope, String status, String delFlag, boolean flag) {
        this.roleId = roleId;
        this.roleName = roleName;
        this.roleKey = roleKey;
        this.roleSort = roleSort;
        this.dataScope = dataScope;
        this.status = status;
        this.delFlag = delFlag;
        this.flag = flag;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(roleId);
        dest.writeString(roleName);
        dest.writeString(roleKey);
        dest.writeString(roleSort);
        dest.writeString(dataScope);
        dest.writeString(status);
        dest.writeString(delFlag);
        dest.writeByte((byte) (flag ? 1 : 0));
    }

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

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

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

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getRoleKey() {
        return roleKey;
    }

    public void setRoleKey(String roleKey) {
        this.roleKey = roleKey;
    }

    public String getRoleSort() {
        return roleSort;
    }

    public void setRoleSort(String roleSort) {
        this.roleSort = roleSort;
    }

    public String getDataScope() {
        return dataScope;
    }

    public void setDataScope(String dataScope) {
        this.dataScope = dataScope;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public boolean getFlag() {
        return this.flag;
    }
}
