package co.yixiang.yshop.module.product.mq.producer;

import co.yixiang.yshop.framework.mq.core.RedisMQTemplate;
import co.yixiang.yshop.module.pay.mq.message.PayRefundMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

@Slf4j
@Component
public class PayRefundProducer {
    @Resource
    private RedisMQTemplate redisMQTemplate;

    /**
     * 发送退款消息
     *
     * @param ids 退款订单id集合
     */
    public void sendPayRefundMessage(List<Long> ids) {
        PayRefundMessage payRefundMessage = new PayRefundMessage().setIds(ids);
        redisMQTemplate.send(payRefundMessage);
    }
}
