package com.qqchen.deploy.backend.deploy.entity;

import com.fasterxml.jackson.databind.JsonNode;
import com.qqchen.deploy.backend.deploy.enums.DeployStatusEnum;
import com.qqchen.deploy.backend.framework.domain.Entity;
import com.vladmihalcea.hibernate.type.json.JsonType;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Type;

import java.time.LocalDateTime;

/**
 * 部署日志实体
 */
@Data
@EqualsAndHashCode(callSuper = true)
@jakarta.persistence.Entity
@Table(name = "deploy_log")
public class DeployLog extends Entity<Long> {


    /**
     * 环境ID
     */
    @Column(name = "workflow_instance_id", nullable = false)
    private Long workflowInstanceId;

    /**
     * 环境ID
     */
    @Column(name = "environment_id", nullable = false)
    private Long environmentId;

    /**
     * 应用ID
     */
    @Column(name = "application_id", nullable = false)
    private Long applicationId;

    /**
     * 部署版本号
     */
    @Column(name = "deploy_version", nullable = false)
    private String deployVersion;

    @Type(JsonType.class)
    @Column(name = "form_variables", columnDefinition = "text", nullable = false)
    private JsonNode formVariables;

    /**
     * 部署参数(JSON)
     */
    @Type(JsonType.class)
    @Column(name = "deploy_variables", columnDefinition = "text", nullable = false)
    private JsonNode deployVariables;

}