package com.yeejoin.amos.boot.module.jyjc.biz.event.publisher;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 */
@Component
public class EventPublisher {
    private ApplicationEventPublisher publisher;

    public EventPublisher(ApplicationEventPublisher publisher) {
        this.publisher = publisher;
    }

    @Async
    public void publish(ApplicationEvent event) {
        publisher.publishEvent(event);
    }
}