package org.xyzh.api.crontab.dto;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.xyzh.common.dto.BaseDTO;
import io.swagger.v3.oas.annotations.media.Schema;

/**
 * 定时任务DTO
 * 用于创建和更新定时任务
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "定时任务DTO")
public class TbCrontabTaskDTO extends BaseDTO {
    private static final long serialVersionUID = 1L;
    
    @Schema(description = "任务ID（更新时需要）")
    private String taskId;
    
    @Schema(description = "任务名称")
    private String taskName;
    
    @Schema(description = "任务分组", defaultValue = "DEFAULT")
    private String taskGroup;
    
    @Schema(description = "任务元数据ID")
    private String metaId;
    
    @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 = "任务状态：0-暂停/1-运行中", defaultValue = "0")
    private Integer status;
    
    @Schema(description = "任务描述")
    private String description;
    
    @Schema(description = "是否允许并发执行", defaultValue = "false")
    private Boolean concurrent;
    
    @Schema(description = "错过执行策略：1-立即执行/2-执行一次/3-放弃执行", defaultValue = "1")
    private Integer misfirePolicy;
}
