feat: 优化job操作
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user