using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CirculateTool.Attribute; /// /// 在指定时间执行的任务 /// /// /// /// /// /// 只能加载公共 void 方法上, /// 不得与同时使用,若同时使用则此项不生效 /// [AttributeUsage(AttributeTargets.Method)] public class CirculationTimeAttribute(string[] times, string? methodDescription = null, string[]? tags = null) : System.Attribute { /// /// 定时执行的时间 /// /// 12:00 /// /// 格式必须为:HH:mm,例如:12:00,其他格式将无效 /// public string[] Times { get; } = times; /// /// 描述 /// public string? MethodDescription { get; } = methodDescription; /// /// 标签 /// public string[]? Tags { get; } = tags; public override string ToString() { return string.Join(",", Times); } }