
package com.tmerclub.cloud.supplier.listener;

import com.tmerclub.cloud.common.rocketmq.config.RocketMqConstant;
import com.tmerclub.cloud.supplier.service.SupplierDetailService;
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_SUPPLIER_TOPIC)
public class OpenAllinpaySupplierConsumer implements RocketMQListener<Integer> {
    private static final Logger LOGGER = LoggerFactory.getLogger(OpenAllinpaySupplierConsumer.class);
    @Autowired
    private SupplierDetailService supplierDetailService;

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