package cn.newfeifan.mall.module.trade.mq.producer.order;

import cn.newfeifan.mall.module.distri.mq.message.order.CalcMessage;
import cn.newfeifan.mall.module.distri.mq.message.order.DistriOrderMessage;
import cn.newfeifan.mall.module.system.mq.message.mail.MailSendMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Component
public class DistriOrderProducer {
    @Resource
    private ApplicationContext applicationContext;


    /**
     * 发送 {@link MailSendMessage} 消息
     *
     * @param tradeOrderDO 当前订单信息
     */
    public void sendDistriOrderMessage(CalcMessage calcMessage) {
        applicationContext.publishEvent(calcMessage);
    }

}
