/// <summary>
/// 这里要注意下，命名空间和程序集是一样的，不然反射不到
/// </summary>
namespace Tiobon.Core.Tasks;

public class Job_StudyRecordSync_Quartz : JobBase, IJob
{
    private readonly IGhre_StudyRecordServices _ghre_StudyRecordServices;

    public Job_StudyRecordSync_Quartz(IGhre_StudyRecordServices ghre_StudyRecordServices, ITasksQzServices tasksQzServices, ITasksLogServices tasksLogServices)
        : base(tasksQzServices, tasksLogServices)
    {
        _ghre_StudyRecordServices = ghre_StudyRecordServices;
    }
    public async Task Execute(IJobExecutionContext context)
    {
        var executeLog = await ExecuteJob(context, async () => await Run(context));
    }
    public async Task Run(IJobExecutionContext context)
    {
        Console.WriteLine($"Job_StudyRecordSync_Quartz 执行 {DateTime.Now.ToShortTimeString()}");
        await _ghre_StudyRecordServices.SyncToESS();
    }
}
