package com.mortals.xhx.base.system.role.model;
import com.mortals.xhx.base.system.role.model.vo.RoleVo;
import lombok.Data;
/**
* 角色信息业务实体对象
*
* @author zxfei
* @date 2024-09-06
*/
@Data
public class RoleEntity extends RoleVo {
    private static final long serialVersionUID = 1L;

    /**
    * 角色名称
    */
    private String name;
    /**
    * 备注
    */
    private String remark;
    /**
    * 角色类型 (0.系统内置角色,1.默认系统角色.2.普通角色)
    */
    private Integer roleType;
    /**
    * 归属客户ID
    */
    private Long customerId;
    /**
    * 创建用户名称
    */
    private String createUserName;
    /**
    * 创建用户名称
    */
    private String updateUserName;
    @Override
    public int hashCode() {
         return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof RoleEntity) {
            RoleEntity tmp = (RoleEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
            this.name = "";
            this.remark = "";
            this.roleType = 2;
            this.customerId = null;
            this.createUserName = "";
            this.updateUserName = "";
    }
}