using Furion.TaskScheduler; using SqlSugar; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace GDZZ.Core.Entity; /// /// 定时任务 /// [SugarTable("sys_timer")] [Description("定时任务")] public class SysTimer : DEntityBase { /// /// 任务名称 /// /// GDZZ [Required, MaxLength(20)] [SugarColumn(ColumnDescription = "任务名称")] public string JobName { get; set; } /// /// 只执行一次 /// [SugarColumn(ColumnDescription = "只执行一次")] public bool DoOnce { get; set; } = false; /// /// 立即执行(默认等待启动) /// [SugarColumn(ColumnDescription = "立即执行(默认等待启动)")] public bool StartNow { get; set; } = false; /// /// 执行类型(并行、列队) /// [SugarColumn(ColumnDescription = "执行类型(并行、列队)")] public SpareTimeExecuteTypes ExecuteType { get; set; } = SpareTimeExecuteTypes.Parallel; /// /// 执行间隔时间(单位秒) /// /// 5 [SugarColumn(ColumnDescription = "执行间隔时间(单位秒)", IsNullable = true)] public int? Interval { get; set; } = 5; /// /// Cron表达式 /// /// [MaxLength(20)] [SugarColumn(ColumnDescription = "Cron表达式", IsNullable = true)] public string Cron { get; set; } /// /// 定时器类型 /// [SugarColumn(ColumnDescription = "定时器类型")] public SpareTimeTypes TimerType { get; set; } = SpareTimeTypes.Interval; /// /// 请求url /// [MaxLength(200)] [SugarColumn(ColumnDescription = "请求url", IsNullable = true)] public string RequestUrl { get; set; } /// /// 请求参数(Post,Put请求用) /// [SugarColumn(ColumnDescription = "请求参数(Post,Put请求用)", IsNullable = true)] public string RequestParameters { get; set; } /// /// Headers(可以包含如:Authorization授权认证) /// 格式:{"Authorization":"userpassword.."} /// [SugarColumn(ColumnDescription = "Headers", IsNullable = true)] public string Headers { get; set; } /// /// 请求类型 /// /// 2 [SugarColumn(ColumnDescription = "请求类型", IsNullable = true)] public RequestTypeEnum RequestType { get; set; } = RequestTypeEnum.Post; /// /// 备注 /// [MaxLength(100)] [SugarColumn(ColumnDescription = "备注", IsNullable = true)] public string Remark { get; set; } }