package com.tmerclub.cloud.biz.linstener;

import com.tmerclub.cloud.biz.service.SendMessageService;
import com.tmerclub.cloud.common.order.vo.SendNotifyBO;
import com.tmerclub.cloud.common.rocketmq.config.RocketMqConstant;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
/**
 * @author lanhai
 */
@Component
@RocketMQMessageListener(topic = RocketMqConstant.SEND_PRODUCT_NOTIFY_TO_SHOP_TOPIC, consumerGroup = RocketMqConstant.SEND_PRODUCT_NOTIFY_TO_SHOP_TOPIC)
public class SendProductNotifyToShopConsumer implements RocketMQListener<List<SendNotifyBO>> {
    @Autowired
    private SendMessageService sendMessageService;

    /**
     * 商品事件推送信息给店铺
     *
     * @param notifyList
     */
    @Override
    public void onMessage(List<SendNotifyBO> notifyList) {
        sendMessageService.sendProductNotifyMsgToShop(notifyList);
    }
}
