package org.springblade.etl.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 任务步骤连接表 etl_job_link
 * 
 * @author aokunsang
 * @date 2023-07-28
 */
@Data
@TableName("etl_job_link")
@ApiModel(value = "JobLink对象", description = "任务步骤连接")
public class JobLink implements Serializable{

	private static final long serialVersionUID = 1L;
	
 	/** 
	 *  
	 */
	@TableId(type = IdType.AUTO)
	private Integer id;
	

	/** 
	 * 任务ID 
	 */
	@ApiModelProperty(value = "任务ID")
	private Integer jobId;

	/** 
	 * 开始节点ID 
	 */
	@ApiModelProperty(value = "开始节点CODE")
	private String fromCode;

	/** 
	 * 结束节点ID 
	 */
	@ApiModelProperty(value = "目标节点CODE")
	private String toCode;

	/** 
	 * 创建时间 
	 */
	@ApiModelProperty(value = "创建时间")
	private LocalDateTime createTime;

	/** 
	 * 租户ID 
	 */
	@ApiModelProperty(value = "租户ID")
	private String tenantId;
	
	@Override
    public boolean equals(Object o) {
		if (o == this) return true;
        if (!(o instanceof JobLink)) return false;
        JobLink jobLink = (JobLink) o;
        return jobLink.fromCode.equals(this.fromCode) && jobLink.toCode.equals(this.toCode);
	}
	
	@Override
    public int hashCode() {
		return this.fromCode.hashCode() + this.toCode.hashCode();
	}
}
