using Quartz;
using SlnMesnac.Business;
using SlnMesnac.Serilog;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace SlnMesnac.Quartz.Job
{
    public class AutoModeJob : IJob
    {

        public readonly SerilogHelper _logger;

        public readonly AutoModeBusiness _autoModeBusiness;

        public AutoModeJob(SerilogHelper logger, AutoModeBusiness autoModeBusiness)
        {
            _logger = logger;
            _autoModeBusiness = autoModeBusiness;
        }

        public Task Execute(IJobExecutionContext context)
        {
            _logger.Info($"执行自动巡检任务：{DateTime.Now.ToString("HH:mm:ss")}");
            _autoModeBusiness.AutoModelEvent();
            return Task.CompletedTask;
        }
    }
}
