using OASystem.API.OAMethodLib.Quartz.Business; using Quartz; namespace OASystem.API.OAMethodLib.Quartz.Jobs { /// /// 任务消息推送 /// 每天下午两点推送 /// public class TaskNewsFeedJob : IJob { private readonly ILogger _logger; public TaskNewsFeedJob(ILogger logger) { _logger = logger; } /// /// 任务消息推送 /// /// /// public async Task Execute(IJobExecutionContext context) { _logger.LogInformation("调用任务消息通知 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); try { //在此处编写任务业务代码 TaskNotification.PostTaskMessageNotification(); } catch (Exception ex) { _logger.LogInformation($"调用任务消息通知ErrorMsg:{ex.Message} " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); } //return Task.CompletedTask; await Task.CompletedTask; } } }