ibms-dome/FrontendWorkerService/Quartz/JobSchedule.cs
2022-10-14 16:08:54 +08:00

46 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
namespace FrontendWorkerService.Quartz
{
/// <summary>
/// Job調度中間對象
/// </summary>
public class JobSchedule
{
public JobSchedule(Type jobType, string cronExpression)
{
this.JobType = jobType ?? throw new ArgumentNullException(nameof(jobType));
CronExpression = cronExpression ?? throw new ArgumentNullException(nameof(cronExpression));
}
/// <summary>
/// Job類型
/// </summary>
public Type JobType { get; private set; }
/// <summary>
/// Cron表達式
/// </summary>
public string CronExpression { get; private set; }
/// <summary>
/// Job狀態
/// </summary>
public JobStatus JobStatu { get; set; } = JobStatus.Init;
}
/// <summary>
/// Job運行狀態
/// </summary>
public enum JobStatus : byte
{
[Description("初始化")]
Init = 0,
[Description("運行中")]
Running = 1,
[Description("調度中")]
Scheduling = 2,
[Description("已停止")]
Stopped = 3,
}
}