using FMSAdmin.QuartzSchedule.Schedulers;
using Microsoft.Extensions.Logging;

namespace FMSAdmin.QuartzSchedule {
    public class Startup {
        private readonly ILogger<Startup> _logger;
        private readonly WorkScheduler _workScheduler;
        private readonly SiteScheduler _siteScheduler;
        private readonly AlarmLogPushScheduler _alarmLogPushScheduler;
        public Startup(ILogger<Startup> logger,
            WorkScheduler workScheduler,
            SiteScheduler siteScheduler,
            AlarmLogPushScheduler alarmLogPushScheduler) {
            _logger = logger;
            _workScheduler = workScheduler;
            _siteScheduler = siteScheduler;
            _alarmLogPushScheduler = alarmLogPushScheduler;
        }

        public void Started() {
            _workScheduler.StartWorkToOrderAndResultEveryDay();
            _siteScheduler.StartSiteWeatherDaily();
            _siteScheduler.StartClearTempFileDaily();
            _alarmLogPushScheduler.Start();
        }
    }
}