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

    /**
    * 角色ID
    */
    private Long roleId;
    /**
    * 菜单ID
    */
    private Long menuId;
    /**
    * 资源ID
    */
    private Long resourceId;
    /**
    * 创建用户名称
    */
    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 RoleAuthEntity) {
            RoleAuthEntity tmp = (RoleAuthEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
            this.roleId = null;
            this.menuId = null;
            this.resourceId = null;
            this.createUserName = "";
            this.updateUserName = "";
    }
}