package com.docus.server.service.impl;

import com.docus.server.common.event.FlowEvent;
import com.docus.server.service.IPublishEventService;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class PublishEventService implements IPublishEventService {

    @Resource
    private ApplicationContext applicationContext;

    /**
     * 发布事件
     */
    @Override
    public void publishEvent(String patientId, FlowEvent.FlowTypeEnum flowTypeEnum) {
        applicationContext.publishEvent(new FlowEvent(this, patientId, flowTypeEnum));
    }

}
