v3.4.6
This commit is contained in:
81
taskschedule/Tnb.TaskScheduler.Entitys/Entity/JobDetails.cs
Normal file
81
taskschedule/Tnb.TaskScheduler.Entitys/Entity/JobDetails.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using JNPF.TaskScheduler.Entitys.Enum;
|
||||
using SqlSugar;
|
||||
|
||||
namespace JNPF.TaskScheduler.Entitys;
|
||||
|
||||
[SugarTable("JobDetails", "作业信息表")]
|
||||
[Tenant("JNPF-Job")]
|
||||
public class JobDetails
|
||||
{
|
||||
/// <summary>
|
||||
/// Id.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "Id", IsPrimaryKey = true, IsIdentity = true)]
|
||||
public virtual long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作业 Id.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作业Id")]
|
||||
public virtual string JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组名称.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "组名称")]
|
||||
public string? GroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作业类型 FullName.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作业类型")]
|
||||
public string? JobType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 程序集 Name.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "程序集")]
|
||||
public string? AssemblyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述信息.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "描述信息")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否并行执行.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否并行执行")]
|
||||
public bool Concurrent { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否扫描特性触发器.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否扫描特性触发器")]
|
||||
public bool IncludeAnnotations { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 额外数据.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "额外数据", ColumnDataType = "longtext,text,clob")]
|
||||
public string? Properties { get; set; } = "{}";
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "更新时间")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作业创建类型.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作业创建类型")]
|
||||
public RequestTypeEnum CreateType { get; set; } = RequestTypeEnum.BuiltIn;
|
||||
|
||||
/// <summary>
|
||||
/// 脚本代码.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "脚本代码", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string? ScriptCode { get; set; }
|
||||
}
|
||||
142
taskschedule/Tnb.TaskScheduler.Entitys/Entity/JobTriggers.cs
Normal file
142
taskschedule/Tnb.TaskScheduler.Entitys/Entity/JobTriggers.cs
Normal file
@@ -0,0 +1,142 @@
|
||||
using JNPF.Schedule;
|
||||
using SqlSugar;
|
||||
|
||||
namespace JNPF.TaskScheduler.Entitys;
|
||||
|
||||
[SugarTable("JobTriggers", "作业触发器表")]
|
||||
[Tenant("JNPF-Job")]
|
||||
public class JobTriggers
|
||||
{
|
||||
/// <summary>
|
||||
/// Id.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "Id", IsPrimaryKey = true, IsIdentity = true)]
|
||||
public virtual long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 触发器 Id.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "触发器Id")]
|
||||
public virtual string TriggerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 作业 Id.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作业Id")]
|
||||
public virtual string JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 触发器类型 FullName.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "触发器类型")]
|
||||
public string? TriggerType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 程序集 Name.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "程序集")]
|
||||
public string? AssemblyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 参数.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "参数")]
|
||||
public string? Args { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述信息.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "描述信息")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态")]
|
||||
public TriggerStatus Status { get; set; } = TriggerStatus.Ready;
|
||||
|
||||
/// <summary>
|
||||
/// 起始时间.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "起始时间")]
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "结束时间")]
|
||||
public DateTime? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近运行时间.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最近运行时间")]
|
||||
public DateTime? LastRunTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下一次运行时间.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "下一次运行时间")]
|
||||
public DateTime? NextRunTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 触发次数.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "触发次数")]
|
||||
public long NumberOfRuns { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大触发次数(0:不限制,n:N次.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最大触发次数")]
|
||||
public long MaxNumberOfRuns { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出错次数.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "出错次数")]
|
||||
public long NumberOfErrors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最大出错次数(0:不限制,n:N次).
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最大出错次数")]
|
||||
public long MaxNumberOfErrors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重试次数.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "重试次数")]
|
||||
public int NumRetries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 重试间隔时间(ms).
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "重试间隔时间(ms)")]
|
||||
public int RetryTimeout { get; set; } = 1000;
|
||||
|
||||
/// <summary>
|
||||
/// 是否立即启动.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否立即启动")]
|
||||
public bool StartNow { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启动时执行一次.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否启动时执行一次")]
|
||||
public bool RunOnStart { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否在启动时重置最大触发次数等于一次的作业.
|
||||
/// </summary>
|
||||
/// <remarks>解决因持久化数据已完成一次触发但启动时不再执行的问题</remarks>
|
||||
[SugarColumn(ColumnDescription = "是否在启动时重置最大触发次数等于一次的作业")]
|
||||
public bool ResetOnlyOnce { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间.
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "更新时间")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using SqlSugar;
|
||||
|
||||
namespace JNPF.TaskScheduler.Entitys.Entity;
|
||||
namespace JNPF.TaskScheduler.Entitys;
|
||||
|
||||
/// <summary>
|
||||
/// 定时任务
|
||||
@@ -11,7 +11,6 @@ namespace JNPF.TaskScheduler.Entitys.Entity;
|
||||
/// 日 期:2021-06-01 .
|
||||
/// </summary>
|
||||
[SugarTable("BASE_TIMETASK")]
|
||||
[Tenant(ClaimConst.TENANTID)]
|
||||
public class TimeTaskEntity : CLDEntityBase
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using SqlSugar;
|
||||
|
||||
namespace JNPF.TaskScheduler.Entitys.Entity;
|
||||
namespace JNPF.TaskScheduler.Entitys;
|
||||
|
||||
/// <summary>
|
||||
/// 定时任务日志
|
||||
|
||||
@@ -1,23 +1,27 @@
|
||||
namespace JNPF.TaskScheduler.Entitys.Enum
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace JNPF.TaskScheduler.Entitys.Enum;
|
||||
|
||||
/// <summary>
|
||||
/// http请求类型.
|
||||
/// </summary>
|
||||
public enum RequestTypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// http请求类型.
|
||||
/// 内置.
|
||||
/// </summary>
|
||||
public enum RequestTypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Api数据.
|
||||
/// </summary>
|
||||
Api = 1,
|
||||
[Description("内置")]
|
||||
BuiltIn = 0,
|
||||
|
||||
/// <summary>
|
||||
/// SQL操作.
|
||||
/// </summary>
|
||||
Sql = 2,
|
||||
/// <summary>
|
||||
/// 脚本.
|
||||
/// </summary>
|
||||
[Description("脚本")]
|
||||
Script = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 执行本地任务.
|
||||
/// </summary>
|
||||
Run = 3,
|
||||
}
|
||||
/// <summary>
|
||||
/// HTTP请求.
|
||||
/// </summary>
|
||||
[Description("HTTP请求")]
|
||||
Http = 2,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.TaskScheduler.Entitys;
|
||||
using JNPF.TaskScheduler.Entitys.Dto.TaskScheduler;
|
||||
using JNPF.TaskScheduler.Entitys.Entity;
|
||||
using JNPF.TaskScheduler.Entitys.Model;
|
||||
using Mapster;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user