package com.njcn.mq.template;

import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
import com.njcn.mq.constant.BusinessResource;
import com.njcn.mq.constant.BusinessTopic;
import com.njcn.mq.message.AppAutoDataMessage;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.stereotype.Component;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2023/8/11 15:28
 */
@Component
public class AppAutoDataMessageTemplate extends RocketMQEnhanceTemplate {

    public AppAutoDataMessageTemplate(RocketMQTemplate template) {
        super(template);
    }

    public SendResult sendMember(AppAutoDataMessage appAutoDataMessage) {
        appAutoDataMessage.setSource(BusinessResource.APP_RESOURCE);
        return send(BusinessTopic.NJCN_APP_AUTO_DATA_TOPIC, BusinessTopic.AppDataTag.STAT_TAG, appAutoDataMessage);
    }
}
