package org.xyzh.api.crontab.vo;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.xyzh.common.vo.BaseVO;
import io.swagger.v3.oas.annotations.media.Schema;
import com.alibaba.fastjson2.annotation.JSONField;
import java.util.Date;

/**
 * 定时任务执行日志VO
 * 用于前端展示任务执行日志
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "定时任务执行日志VO")
public class CrontabLogVO extends BaseVO {
    private static final long serialVersionUID = 1L;
    
    @Schema(description = "日志ID")
    private String logId;
    
    @Schema(description = "任务ID")
    private String taskId;
    
    @Schema(description = "任务名称")
    private String taskName;
    
    @Schema(description = "任务分组")
    private String taskGroup;
    
    @Schema(description = "Bean名称")
    private String beanName;
    
    @Schema(description = "方法名称")
    private String methodName;
    
    @Schema(description = "方法参数")
    private String methodParams;
    
    @Schema(description = "执行状态：0-失败/1-成功")
    private Integer executeStatus;
    
    @Schema(description = "执行状态名称")
    private String executeStatusName;
    
    @Schema(description = "执行状态颜色")
    private String executeStatusColor;
    
    @Schema(description = "执行结果信息")
    private String executeMessage;
    
    @Schema(description = "异常信息")
    private String exceptionInfo;
    
    @Schema(description = "是否有异常", defaultValue = "false")
    private Boolean hasException;
    
    @Schema(description = "开始时间", format = "date-time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    
    @Schema(description = "结束时间", format = "date-time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
    
    @Schema(description = "执行时长（毫秒）")
    private Integer executeDuration;
    
    @Schema(description = "执行时长格式化显示")
    private String executeDurationFormatted;
}
