package jnpf.cultivate.utils;
/**
 * 任务异步处理
 *
 * @Author: xuguilin
 * @create: 2024/9/20:15:50
 */

import jnpf.model.cultivate.po.learn.FtbCultivateLearnTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class CultivateTaskLeanAsyncDealUtil {


    @Autowired
    @Lazy
    private CultivateLearnUtils cultivateLearnUtils;

    /**
     * 任务开始发送消息
     *
     * @param taskList   任务id集合
     * @param tenantCode 租户id
     */
    public void asyncSendStartTaskLearningAlert(List<FtbCultivateLearnTask> taskList, String tenantCode) {
        cultivateLearnUtils.sendStartTaskLearningAlert(taskList, tenantCode);
    }

    /**
     * 异步处理 用户的任务状态
     *
     * @param tenantCode
     */
    public void asyncUpdateUserTaskStatus(String tenantCode) {
        cultivateLearnUtils.updateLongTaskUserTaskStatus(tenantCode);
    }
}
