
package com.tmerclub.cloud.multishop.listener;

import com.tmerclub.cloud.common.rocketmq.config.RocketMqConstant;
import com.tmerclub.cloud.multishop.service.ShopDetailService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author TRACK
 */
@Component
@RocketMQMessageListener(topic = RocketMqConstant.OPEN_ALLINPAY_TOPIC,consumerGroup = RocketMqConstant.OPEN_ALLINPAY_SHOP_TOPIC)
public class OpenAllinpayShopConsumer implements RocketMQListener<Integer> {
    private static final Logger LOGGER = LoggerFactory.getLogger(OpenAllinpayShopConsumer.class);
    @Autowired
    private ShopDetailService shopDetailService;

    /**
     * 开启通联，店铺批量创建会员
     */
    @Override
    public void onMessage(Integer paySysType) {
        LOGGER.info("店铺开始批量创建会员");
        shopDetailService.createAllinpayMember();
    }
}
