You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.4 KiB
C#

1 year ago
using Admin.Core.Common;
using Admin.Core.Model;
using Admin.Core.Model.Sys;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Admin.Core.Tasks
{
/// <summary>
/// 服务调度接口
/// </summary>
public interface ISchedulerCenter
{
/// <summary>
/// 开启任务调度
/// </summary>
/// <returns></returns>
Task<MessageModel<string>> StartScheduleAsync();
/// <summary>
/// 停止任务调度
/// </summary>
/// <returns></returns>
Task<MessageModel<string>> StopScheduleAsync();
/// <summary>
///
/// </summary>
/// <param name="sysSchedule"></param>
/// <returns></returns>
Task<MessageModel<string>> AddScheduleJobAsync(SysTasksQz sysSchedule);
/// <summary>
/// 停止一个任务
/// </summary>
/// <param name="sysSchedule"></param>
/// <returns></returns>
Task<MessageModel<string>> StopScheduleJobAsync(SysTasksQz sysSchedule);
/// <summary>
/// 检测任务是否存在
/// </summary>
/// <param name="sysSchedule"></param>
/// <returns></returns>
Task<bool> IsExistScheduleJobAsync(SysTasksQz sysSchedule);
/// <summary>
/// 暂停指定的计划任务
/// </summary>
/// <param name="sysSchedule"></param>
/// <returns></returns>
Task<MessageModel<string>> PauseJob(SysTasksQz sysSchedule);
/// <summary>
/// 恢复一个任务
/// </summary>
/// <param name="sysSchedule"></param>
/// <returns></returns>
Task<MessageModel<string>> ResumeJob(SysTasksQz sysSchedule);
/// <summary>
/// 获取任务触发器状态
/// </summary>
/// <param name="sysSchedule"></param>
/// <returns></returns>
Task<List<TaskInfoDto>> GetTaskStaus(SysTasksQz sysSchedule);
/// <summary>
/// 获取触发器标识
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
string GetTriggerState(string key);
/// <summary>
/// 立即执行 一个任务
/// </summary>
/// <param name="SysTasksQz"></param>
/// <returns></returns>
Task<MessageModel<string>> ExecuteJobAsync(SysTasksQz SysTasksQz);
}
}