feat: 优化job操作
This commit is contained in:
@@ -80,5 +80,8 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Task
|
|||||||
/// 触发器类型
|
/// 触发器类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public JobTypeEnum Type { get; set; }
|
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.TriggerArgs =Math.Round(simple.RepeatInterval.TotalMinutes,2) .ToString() + "分钟";
|
||||||
output.Type = JobTypeEnum.Millisecond;
|
output.Type = JobTypeEnum.Millisecond;
|
||||||
|
output.Millisecond = simple.RepeatInterval.TotalMilliseconds;
|
||||||
}
|
}
|
||||||
else if (trigger is ICronTrigger cron)
|
else if (trigger is ICronTrigger cron)
|
||||||
{
|
{
|
||||||
output.TriggerArgs = cron.CronExpressionString!;
|
output.TriggerArgs = cron.CronExpressionString!;
|
||||||
output.Type = JobTypeEnum.Cron;
|
output.Type = JobTypeEnum.Cron;
|
||||||
|
output.Cron=cron.CronExpressionString;
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user