package com.tuoheng.admin.service.flightdata;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 异步任务接口实现
 */
@Slf4j
@Service
public class AsyncServiceImpl implements AsyncService {

    @Autowired
    private IFlightDataService flightDataService;

    @Async("asyncServiceExecutor")
    public void flightDataSaveBatch(List list) {
        log.info("线程-" + Thread.currentThread().getId() + "在执行写入");
        flightDataService.saveBatch(list);
    }
}
