package com.mortals.xhx.module.data.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.data.model.vo.DataSourceVo;
import lombok.Data;
/**
* 数据源实体对象
*
* @author zxfei
* @date 2023-07-15
*/
@Data
public class DataSourceEntity extends DataSourceVo {
    private static final long serialVersionUID = 1L;

    /**
    * 数据源名称
    */
    @Excel(name = "数据源名称")
    private String name;
    /**
    * 来源系统
    */
    @Excel(name = "来源系统")
    private String sourceSystem;
    /**
    * 数据源类型(1.MySQL,2.SQLServer,3.Oracle,4.PostgreSQL,5.MongoDB,6.Redis,7.其他)
    */
    @Excel(name = "数据源类型", readConverterExp = "1=MySQL,2.SQLServer,3.Oracle,4.PostgreSQL,5.MongoDB,6.Redis,7.其他")
    private String type;
    /**
    * ip
    */
    @Excel(name = "ip")
    private String ip;
    /**
    * 端口
    */
    @Excel(name = "端口")
    private String port;
    /**
    * 服务名称
    */
    @Excel(name = "服务名称")
    private String serverName;
    /**
    * 用户名
    */
    @Excel(name = "用户名")
    private String userName;
    /**
    * 密码
    */
    @Excel(name = "密码")
    private String password;
    /**
    * 任务状态(0.停用,1.启用)
    */
    @Excel(name = "任务状态", readConverterExp = "0=停用,1.启用")
    private String statuses;
    /**
    * 备注
    */
    private String remark;
    @Override
    public int hashCode() {
         return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof DataSourceEntity) {
            DataSourceEntity tmp = (DataSourceEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public void initAttrValue(){

            this.name = "";

            this.sourceSystem = "";

            this.type = "";

            this.ip = "";

            this.port = "";

            this.serverName = "";

            this.userName = "";

            this.password = "";

            this.statuses = "0";

            this.remark = "";
    }
}