package com.gzlh.bus; import cn.hutool.core.thread.ThreadUtil; import com.gzlh.config.dto.EventDTO; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import java.util.List; @Component @Slf4j public class EventBus { private List eventDTOList; public void setEventDTOList(List eventDTOList) { this.eventDTOList = eventDTOList; } /** * 触发事件 * @param eventName */ public void startEvent(String eventName){ EventThread thread = new EventThread(eventName); thread.setEventDTOList(eventDTOList); ThreadUtil.execute(thread); } }