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

    /**
    * 名称
    */
    private String name;
    /**
    * 分组名称
    */
    private String groupName;
    /**
    * 连接地址，多个地址以逗号分隔
    */
    private String url;
    /**
    * 权限类型 (0.无限制，1.无需登录查看，2.需要登录查看，3.需要角色权限查看)
    */
    private Integer authType;
    /**
    * 资源类型，(0.系统资源，1.开放资源)
    */
    private Integer sourceType;
    /**
    * 创建用户名称
    */
    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 ResourceEntity) {
            ResourceEntity tmp = (ResourceEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
            this.name = "";
            this.groupName = "";
            this.url = "";
            this.authType = 3;
            this.sourceType = 0;
            this.createUserName = "";
            this.updateUserName = "";
    }
}