package com.qqchen.deploy.backend.deploy.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 部署节点日志响应DTO
 *
 * @author qqchen
 * @since 2025-11-07
 */
@Data
@Schema(description = "部署节点日志响应")
public class DeployNodeLogDTO {
    
    @Schema(description = "流程实例ID")
    private String processInstanceId;
    
    @Schema(description = "节点ID")
    private String nodeId;
    
    @Schema(description = "节点名称")
    private String nodeName;
    
    @Schema(description = "日志列表")
    private List<LogEntry> logs;
    
    @Schema(description = "日志是否已过期（超过7天被清除）")
    private Boolean expired;
    
    @Schema(description = "提示信息")
    private String message;
    
    /**
     * 日志条目
     */
    @Data
    @Schema(description = "日志条目")
    public static class LogEntry {
        
        @Schema(description = "序列号")
        private Long sequenceId;
        
        @Schema(description = "时间戳（毫秒）")
        private Long timestamp;
        
        @Schema(description = "日志级别（INFO/WARN/ERROR/DEBUG）")
        private String level;
        
        @Schema(description = "日志来源（JENKINS/FLOWABLE/SHELL/NOTIFICATION）")
        private String source;
        
        @Schema(description = "日志内容")
        private String message;
    }
}

