package com.zhongshu.card.server.core.domain.schedule;

import cn.hutool.json.JSONObject;
import com.zhongshu.card.client.type.DataState;
import com.zhongshu.card.client.type.ScheduleType;
import com.zhongshu.card.server.core.domain.base.SuperMain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.HashMap;

/**
 * 定时任务记录
 *
 * @author TRX
 * @date 2024/11/4
 */
@Data
@Document
@AllArgsConstructor
@NoArgsConstructor
public class ScheduleTaskConfig extends SuperMain {

    @Schema(description = "关联的数据ID")
    private String aboutDataId;

    @Schema(description = "关联的数据")
    private HashMap<String, Object> data = new HashMap<>();

    @Schema(description = "定时任务类型")
    private ScheduleType scheduleType;

    @Schema(description = "数据状态")
    private DataState dataState = DataState.Enable;

    @Schema(description = "定时任务的表达式")
    private String expression;

    @Schema(description = "执行状态 1.正在执行 0.等待执行")
    private Integer executeStatus = 0;

    @Schema(description = "中心token")
    private String token;

    @Schema(description = "过期时间")
    private Long expireAt;

}
