package cd.casic.ci.process.process.dataObject.task;

import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;

import java.util.Map;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName(autoResultMap = true)
public class PipTask extends PipBaseElement {

    //@ApiProperty(name="taskType",desc= "类型1-10:源码,10-20:测试,20-30:构建,30-40:部署,40-50:代码扫描,50-60:推送制品")
    private String taskType;

    //@ApiProperty(name="taskSort",desc="顺序")
    private int taskSort;

    //@ApiProperty(name="taskName",desc="顺序")
    private String taskName;

    //@ApiProperty(name="pipeline",desc="流水线id",eg="@selectOne")
    private String pipelineId;

    //@ApiProperty(name="postprocessId",desc="后置处理id",eg="@selectOne")
    private String postprocessId;;

    //@ApiProperty(name="stageId",desc="阶段",eg="@selectOne")
    private String stageId;
    // task节点配置
    @TableField(typeHandler = JacksonTypeHandler.class,jdbcType = JdbcType.VARCHAR)
    private Map<String,Object> taskProperties;

    // 执行实例id
    @TableField(exist = false)
    private String instanceId;

}
