package cn.yunzhixue.ability.center.examsprint.application.report;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class AsyncExamSprintReportGenerationDispatcher implements ExamSprintReportGenerationDispatcher {

    private final ExamSprintReportGenerationWorker worker;

    public AsyncExamSprintReportGenerationDispatcher(ExamSprintReportGenerationWorker worker) {
        this.worker = worker;
    }

    @Override
    @Async("examSprintReportExecutor")
    public void dispatch(String reportId) {
        worker.process(reportId);
    }
}
