package cn.palmte.work.service;

import cn.palmte.work.model.ExcelEvent;
import cn.palmte.work.model.ExportExcelBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

/**
 * @author ZM
 * @date 2018/9/21
 */
@Service
public class ExcelEventService {
    @Autowired
    ApplicationContext applicationContext;

    /**
     * 异步导出excel方法
     */
    public void exportExcel(ExportExcelBean exportExcelBean){
        //发布异步导出excel事件
        applicationContext.publishEvent(new ExcelEvent(this,exportExcelBean));
    }
}
