package com.njcn.mq.template;

import com.alibaba.fastjson.JSON;
import com.njcn.middle.rocket.domain.BaseMessage;
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
import com.njcn.mq.constant.BusinessResource;
import com.njcn.mq.constant.BusinessTopic;
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
 */
@Component
public class BZEventMessageTemplate extends RocketMQEnhanceTemplate {

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

    public SendResult sendMember(Object message, String tag) {
        BaseMessage baseMessage = new BaseMessage();
        baseMessage.setSource(BusinessResource.WEB_RESOURCE);
        baseMessage.setMessageBody(JSON.toJSONString(message));
        return send(BusinessTopic.ASK_RECALL_TOPIC,tag,baseMessage);
    }
}
