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 CrontabTaskVO extends BaseVO {
    private static final long serialVersionUID = 1L;
    
    @Schema(description = "任务ID")
    private String taskId;
    
    @Schema(description = "任务名称")
    private String taskName;
    
    @Schema(description = "任务分组")
    private String taskGroup;
    
    @Schema(description = "任务元数据ID")
    private String metaId;
    
    @Schema(description = "元数据名称")
    private String metaName;
    
    @Schema(description = "是否使用默认接收人", defaultValue = "false")
    private Boolean defaultRecipient;
    
    @Schema(description = "Bean名称")
    private String beanName;
    
    @Schema(description = "方法名称")
    private String methodName;
    
    @Schema(description = "方法参数")
    private String methodParams;
    
    @Schema(description = "Cron表达式")
    private String cronExpression;
    
    @Schema(description = "Cron表达式描述（中文）")
    private String cronDescription;
    
    @Schema(description = "任务状态")
    private Integer status;
    
    @Schema(description = "任务状态名称")
    private String statusName;
    
    @Schema(description = "任务描述")
    private String description;
    
    @Schema(description = "是否允许并发执行", defaultValue = "false")
    private Boolean concurrent;
    
    @Schema(description = "错过执行策略")
    private Integer misfirePolicy;
    
    @Schema(description = "错过执行策略名称")
    private String misfirePolicyName;
    
    @Schema(description = "下次执行时间", format = "date-time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date nextExecuteTime;
    
    @Schema(description = "最后执行时间", format = "date-time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date lastExecuteTime;
    
    @Schema(description = "最后执行状态：0-失败/1-成功")
    private Integer lastExecuteStatus;
    
    @Schema(description = "创建者姓名")
    private String creatorName;
    
    @Schema(description = "更新者姓名")
    private String updaterName;
}
