feat: 优化job操作

This commit is contained in:
陈淳
2024-01-13 16:44:39 +08:00
parent 36e9938011
commit 4e5f51a4c8
2 changed files with 5 additions and 0 deletions

View File

@@ -80,5 +80,8 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Task
/// 触发器类型
/// </summary>
public JobTypeEnum Type { get; set; }
public string? Cron { get; set; }
public double? Millisecond { get; set; }
}
}

View File

@@ -58,11 +58,13 @@ namespace Yi.Framework.Rbac.Application.Services
{
output.TriggerArgs =Math.Round(simple.RepeatInterval.TotalMinutes,2) .ToString() + "分钟";
output.Type = JobTypeEnum.Millisecond;
output.Millisecond = simple.RepeatInterval.TotalMilliseconds;
}
else if (trigger is ICronTrigger cron)
{
output.TriggerArgs = cron.CronExpressionString!;
output.Type = JobTypeEnum.Cron;
output.Cron=cron.CronExpressionString;
}
return output;
}