package com.mortals.xhx.module.door.model;
import com.mortals.xhx.module.door.model.vo.DoorVo;
import lombok.Data;
/**
* 门禁设备实体对象
*
* @author zxfei
* @date 2023-11-22
*/
@Data
public class DoorEntity extends DoorVo {
    private static final long serialVersionUID = 1L;

    /**
    * 设备名称
    */
    private String deviceName;
    /**
    * 设备编码
    */
    private String deviceCode;
    /**
    * Ip地址
    */
    private String ip;
    /**
    * 端口
    */
    private Integer port;
    /**
    * 用户名
    */
    private String username;
    /**
    * 密码
    */
    private String password;
    @Override
    public int hashCode() {
         return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof DoorEntity) {
            DoorEntity tmp = (DoorEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
            this.deviceName = "";
            this.deviceCode = "";
            this.ip = "";
            this.port = 0;
            this.username = "";
            this.password = "";
    }
}