xiaoyong931011
2023-10-30 c1ca2981080dbd1d487758fb5f16719aa6d68489
src/main/java/cc/mrbird/febs/rabbit/producter/AgentProducer.java
@@ -3,6 +3,7 @@
import cc.mrbird.febs.rabbit.constants.ExchangeConstants;
import cc.mrbird.febs.rabbit.constants.RouteKeyConstants;
import cc.mrbird.febs.rabbit.enumerates.RabbitQueueEnum;
import cn.hutool.core.util.IdUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.Message;
@@ -45,4 +46,40 @@
    }
    /**
     * 添加会员
     */
    public void sendAddRobotMsg(String inviteId) {
        log.info("添加会员:{}", inviteId);
        CorrelationData correlationData = new CorrelationData(IdUtil.simpleUUID());
        rabbitTemplate.convertAndSend(RabbitQueueEnum.IM_REDBAG_GET_ADD_ROBOT.getExchange(),
                RabbitQueueEnum.IM_REDBAG_GET_ADD_ROBOT.getRoute(),
                inviteId,
                correlationData);
    }
    /**
     * 自动发送
     */
    public void sendAutoSendMsg(Long groupId) {
//        log.info("自动发送:{}", groupId);
        CorrelationData correlationData = new CorrelationData(IdUtil.simpleUUID());
        rabbitTemplate.convertAndSend(RabbitQueueEnum.IM_REDBAG_AUTO_SEND.getExchange(),
                RabbitQueueEnum.IM_REDBAG_AUTO_SEND.getRoute(),
                groupId,
                correlationData);
    }
    /**
     * 自动返还
     */
    public void sendOverdueSendMsg(Long redbagId) {
        log.info("自动返还:{}", redbagId);
        CorrelationData correlationData = new CorrelationData(IdUtil.simpleUUID());
        rabbitTemplate.convertAndSend(RabbitQueueEnum.IM_REDBAG_OVERDUE.getExchange(),
                RabbitQueueEnum.IM_REDBAG_OVERDUE.getRoute(),
                redbagId,
                correlationData);
    }
}