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

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

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