package com.xingxi.common.mq.publisher.order;

import com.alibaba.fastjson.JSON;
import com.xingxi.common.mq.bo.order.OrderDetailBO;
import com.xingxi.common.mq.constant.OrderMqKey;
import com.xingxi.common.mq.core.AbstractRabbitPublisher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @ClassName OrderDeliveredMqPublisher
 * @projectName Xingxi
 * @Deacription 订单发货后发送消息
 * @Author FZ.Dong
 * @Date 2020/9/15 16:32
 * @Version 1.0
 **/


@Slf4j
@Component
public class OrderDeliveredMqPublisher extends AbstractRabbitPublisher {

    /**
     * 订单发货后发送消息
     * @param orderDetailBO
     */
    public void sendMessage(OrderDetailBO orderDetailBO) {
        log.info("订单发货完成推送订单消息[{}]", JSON.toJSONString(orderDetailBO));

        super.send(orderDetailBO, OrderMqKey.EDIT_EXCHANGE, OrderMqKey.EDIT_ROUTE_FOR_DELIVERED);
    }
}
