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

import com.alibaba.fastjson.JSON;
import com.xingxi.common.mq.bo.order.OrderFinishedBO;
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 OrderFinishedMqPublisher
 * @projectName Xingxi
 * @Deacription
 * @Author FZ.Dong
 * @Date 2020/9/17 10:54
 * @Version 1.0
 **/


@Slf4j
@Component
public class OrderFinishedMqPublisher extends AbstractRabbitPublisher {

    /**
     * 发送完成之后的订单
     * @param orderFinishedBO
     */
    public void sendMessage(OrderFinishedBO orderFinishedBO) {
        log.info("订单完成推送信息[{}]", JSON.toJSONString(orderFinishedBO));
        super.send(orderFinishedBO, OrderMqKey.EDIT_EXCHANGE, OrderMqKey.EDIT_ROUTE_FOR_FINISHED);
    }
}
