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.AppEventMessage;
import com.njcn.mq.message.RmpEventDetailMessage;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.stereotype.Component;

/**
 * pqs
 *
 * @author cdf
 * @date 2023/8/24
 */
@Component
public class RmpEventDetailMessageTemplate extends RocketMQEnhanceTemplate {
    public RmpEventDetailMessageTemplate(RocketMQTemplate template) {
        super(template);
    }

    public SendResult sendEventDetail(RmpEventDetailMessage rmpEventDetailMessage) {
        rmpEventDetailMessage.setSource(BusinessResource.WEB_RESOURCE);
        return send(BusinessTopic.RMP_EVENT_DETAIL_TOPIC, rmpEventDetailMessage);
    }
}
