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

import com.qqchen.deploy.backend.framework.dto.BaseDTO;
import com.qqchen.deploy.backend.schedule.enums.JobStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 定时任务执行日志DTO
 * 
 * @author qichen
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "定时任务执行日志")
public class ScheduleJobLogDTO extends BaseDTO {

     @Schema(description = "任务ID")
    private Long jobId;

    @Schema(description = "任务名称")
    private String jobName;

    // ==================== 执行信息 ====================

    @Schema(description = "执行器Bean名称")
    private String beanName;

    @Schema(description = "执行方法名称")
    private String methodName;

    @Schema(description = "方法参数")
    private String methodParams;

    // ==================== 时间统计 ====================

    @Schema(description = "开始执行时间")
    private LocalDateTime executeTime;

    @Schema(description = "完成时间")
    private LocalDateTime finishTime;

    @Schema(description = "执行耗时（毫秒）")
    private Long duration;

    // ==================== 状态信息 ====================

    @Schema(description = "执行状态")
    private JobStatusEnum status;

    @Schema(description = "执行结果消息")
    private String resultMessage;

    @Schema(description = "异常堆栈信息")
    private String exceptionInfo;

    // ==================== 服务器信息 ====================

    @Schema(description = "执行服务器IP")
    private String serverIp;

    @Schema(description = "执行服务器主机名")
    private String serverHost;
}

