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

public class Job_Tiobons_Quartz : JobBase, IJob
{ 
    private readonly IGhre_ExamServices _ghre_ExamServices;

    public Job_Tiobons_Quartz(IGhre_ExamServices ghre_ExamServices, ITasksQzServices tasksQzServices, ITasksLogServices tasksLogServices)
        : base(tasksQzServices, tasksLogServices)
    {
        _ghre_ExamServices = ghre_ExamServices;
    }
    public async Task Execute(IJobExecutionContext context)
    {
        var executeLog = await ExecuteJob(context, async () => await Run(context));
    }
    public async Task Run(IJobExecutionContext context)
    {
        Console.WriteLine($"Job_Tiobons_Quartz 执行 {DateTime.Now.ToShortTimeString()}");
        await _ghre_ExamServices.ExecuteExamOver();
        // 也可以通过数据库配置，获取传递过来的参数
        JobDataMap data = context.JobDetail.JobDataMap;
        //int jobId = data.GetInt("JobParam");
    }
}
