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

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

import java.util.List;

/**
 * @ClassName OrderReturnedMqPublisher
 * @projectName Xingxi
 * @Deacription 支付完成订单推送
 * @Author FZ.Dong
 * @Date 2020/9/15 16:32
 * @Version 1.0
 **/


@Slf4j
@Component
public class OrderReturnedMqPublisher extends AbstractRabbitPublisher {

    /**
     * 退货完成之后发送,更新订单数量
     */
    public void sendMessage(List<OrderReturnedBO> list) {
        log.info("退货完成推送确认退货信息[{}]", JSON.toJSONString(list));
        if (!list.isEmpty()) {
            super.send(list, OrderMqKey.EDIT_EXCHANGE, OrderMqKey.EDIT_ROUTE_FOR_RETURNED);
        }
    }
}
