

package com.zcloud.modules.job.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 定时任务
 *
 *
 */
@Data
@TableName("schedule_job_cmt")
public class ScheduleJobEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 任务调度参数key
	 */
    public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";

	/**
	 * 任务id
	 */
	@TableId(value = "job_id",type = IdType.ASSIGN_UUID)
	@TableField(value = "job_id")
	@JsonProperty(value = "jobId")
	private String jobId;

	/**
	 * spring bean名称
	 */
	@NotBlank(message="bean名称不能为空")
	@TableField(value = "bean_name")
	@JsonProperty(value = "beanName")
	private String beanName;

	/**
	 * 参数
	 */
	@TableField(value = "params")
	@JsonProperty(value = "params")
	private String params;

	/**
	 * cron表达式
	 */
	@NotBlank(message="cron表达式不能为空")
	@TableField(value = "cron_expression")
	@JsonProperty(value = "cronExpression")
	private String cronExpression;

	/**
	 * 任务状态
	 */
	@TableField(value = "status")
	@JsonProperty(value = "status")
	private Integer status;

	/**
	 * 备注
	 */
	@TableField(value = "remark")
	@JsonProperty(value = "remark")
	private String remark;

	/**
	 * 创建时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@TableField(value = "create_time")
	@JsonProperty(value = "create_time")
	private Date createTime;


}
