package com.ruoyi.common.thread;

import com.ruoyi.project.monitor.domain.SysJob;
import com.ruoyi.project.monitor.service.ISysJobService;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;

public class TaskThread implements Runnable {

    private ISysJobService jobService;

    private SysJob job;
    public TaskThread(SysJob job ,ISysJobService jobService ){
        this.job = job;
        this.jobService = jobService;
    }

    @Override
    public void run() {
        try {
            this.jobService.run(job);
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
    }
}
