package com.ruoyi.workflow.domain;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 工作流定义对象 dc_workflow_definition
 * 
 * @author ruoyi
 * @date 2025-12-19
 */
public class WorkflowDefinition extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 工作流定义ID */
    private Long definitionId;

    /** 工作流名称 */
    @Excel(name = "工作流名称")
    @NotBlank(message = "工作流名称不能为空")
    @Size(min = 0, max = 100, message = "工作流名称长度不能超过100个字符")
    private String workflowName;

    /** 工作流版本 */
    @Excel(name = "工作流版本")
    private String version;

    /** 工作流描述 */
    @Excel(name = "工作流描述")
    private String description;

    /** 工作流定义JSON */
    private String definitionJson;

    /** 工作流状态(0启用 1禁用) */
    @Excel(name = "工作流状态", readConverterExp = "0=启用,1=禁用")
    private String status;

    /** 创建者 */
    @Excel(name = "创建者")
    private String creator;

    /** 发布时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date publishTime;

    /** 是否为默认版本(0否 1是) */
    @Excel(name = "是否为默认版本", readConverterExp = "0=否,1=是")
    private String isDefault;

    public void setDefinitionId(Long definitionId) 
    {
        this.definitionId = definitionId;
    }

    public Long getDefinitionId() 
    {
        return definitionId;
    }

    public void setWorkflowName(String workflowName) 
    {
        this.workflowName = workflowName;
    }

    public String getWorkflowName() 
    {
        return workflowName;
    }

    public void setVersion(String version) 
    {
        this.version = version;
    }

    public String getVersion() 
    {
        return version;
    }

    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }

    public void setDefinitionJson(String definitionJson) 
    {
        this.definitionJson = definitionJson;
    }

    public String getDefinitionJson() 
    {
        return definitionJson;
    }

    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }

    public void setCreator(String creator) 
    {
        this.creator = creator;
    }

    public String getCreator() 
    {
        return creator;
    }

    public void setPublishTime(Date publishTime) 
    {
        this.publishTime = publishTime;
    }

    public Date getPublishTime() 
    {
        return publishTime;
    }

    public void setIsDefault(String isDefault) 
    {
        this.isDefault = isDefault;
    }

    public String getIsDefault() 
    {
        return isDefault;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("definitionId", getDefinitionId())
            .append("workflowName", getWorkflowName())
            .append("version", getVersion())
            .append("description", getDescription())
            .append("definitionJson", getDefinitionJson())
            .append("status", getStatus())
            .append("creator", getCreator())
            .append("publishTime", getPublishTime())
            .append("isDefault", getIsDefault())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}