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

import com.alibaba.fastjson.JSON;
import com.xingxi.common.mq.bo.order.OrderBO;
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 OrderPayedMqPublisher
 * @projectName Xingxi
 * @Deacription 支付完成订单推送
 * @Author FZ.Dong
 * @Date 2020/9/15 16:32
 * @Version 1.0
 **/


@Slf4j
@Component
public class OrderPayedMqPublisher extends AbstractRabbitPublisher {

    /**
     * 支付完成后发送消息
     * @param orderBO
     */
    public void sendMessage(OrderBO orderBO) {
        log.info("订单支付完成发送消息[{}]", JSON.toJSONString(orderBO));
        super.send(orderBO, OrderMqKey.EDIT_EXCHANGE, OrderMqKey.EDIT_ROUTE_FOR_PAYED);
    }
}
