xiaoyong931011
2023-07-15 962adfda22354192f98231771423593ade145e00
src/main/java/cc/mrbird/febs/rabbit/producter/AgentProducer.java
@@ -12,6 +12,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.UUID;
@@ -47,7 +48,7 @@
    public void sendOrderReturn(Long id) {
        log.info("发送消息:{}", id);
        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
        rabbitTemplate.convertAndSend(ExchangeConstants.EXCHANGE_DEFAULT, RouteKeyConstants.ROUTE_KEY_DEFAULT, id, correlationData);
        rabbitTemplate.convertAndSend(RabbitQueueEnum.ORDER_RETURN_MONEY.getExchange(), RabbitQueueEnum.ORDER_RETURN_MONEY.getRoute(), id, correlationData);
    }
    public void sendOrderCancelDelayMsg(Long id, Long times) {
@@ -60,4 +61,29 @@
            }
        });
    }
    /**
     * 发送代理自动升级消息
     *
     * @param memberId
     */
    public void sendAutoLevelUpMsg(@NotNull Long memberId) {
        log.info("发送代理自动升级消息:{}", memberId);
        rabbitTemplate.convertAndSend(ExchangeConstants.EXCHANGE_DEFAULT, RouteKeyConstants.ROUTE_KEY_DEFAULT, memberId);
    }
    public void sendReturnMoneyMsg(Long orderId) {
        log.info("发送返利消息:{}", orderId);
        rabbitTemplate.convertAndSend(RabbitQueueEnum.AGENT_REUTRN_MONEY.getExchange(), RabbitQueueEnum.AGENT_REUTRN_MONEY.getRoute(), orderId);
    }
    public void sendMemberSubMsg(String memberOpenId) {
        log.info("新增用户关注:{}", memberOpenId);
        rabbitTemplate.convertAndSend(RabbitQueueEnum.YWG_MEMBER_SUB.getExchange(), RabbitQueueEnum.YWG_MEMBER_SUB.getRoute(), memberOpenId);
    }
    public void sendMemberSubScanMsg(String str) {
        log.info("新增用户扫码:{}", str);
        rabbitTemplate.convertAndSend(RabbitQueueEnum.YWG_MEMBER_SUB_SCAN.getExchange(), RabbitQueueEnum.YWG_MEMBER_SUB_SCAN.getRoute(), str);
    }
}