namespace Dlhis.ScheduledTask.Attributes; /// /// 用于标记一个类为定时任务的特性。 /// [AttributeUsage(AttributeTargets.Class)] public class RecurringJobAttribute : Attribute { /// /// 初始化 类的新实例。 /// /// 任务的唯一标识符。 /// Cron 表达式,定义任务的执行计划。 public RecurringJobAttribute(string uniqueJobKey, string cron) { UniqueJobKey = uniqueJobKey; Cron = cron; } /// /// 任务名称(可选)。 /// public string Name { get; set; } /// /// 任务的唯一标识符。 /// public string UniqueJobKey { get; } /// /// Cron 表达式,定义任务的执行计划。 /// public string Cron { get; } /// /// 是否在开发环境中运行。 /// public bool RunOnDevelopment { get; set; } = false; /// /// 任务所属队列,默认为 "default"。 /// public string Queue { get; set; } = "default"; }