KKSU
2024-05-11 04b73bbb2b20f0c3bef5c8ca94edf97eeb9d0994
src/main/java/cc/mrbird/febs/rabbit/producer/ChainProducer.java
@@ -1,13 +1,10 @@
package cc.mrbird.febs.rabbit.producer;
import cc.mrbird.febs.rabbit.QueueEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.UUID;
/**
 * @author wzy
@@ -33,21 +30,52 @@
    }
    public void sendOnlineTransfer(String batchNo) {
        log.info("发送链上转账消息:{}", batchNo);
        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
        rabbitTemplate.convertAndSend(QueueEnum.ONLINE_TRANSFER.getExchange(), QueueEnum.ONLINE_TRANSFER.getRoute(), batchNo, correlationData);
    }
//    /**
//     *  speed 支付订单
//     * @param orderId 订单ID
//     */
//    public void sendSpeedPayOrderMsg(Long orderId) {
//        log.info("sendSpeedPayOrderMsg:{}", orderId);
//        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
//        rabbitTemplate.convertAndSend(QueueEnum.SPEED_PAY_ORDER.getExchange(), QueueEnum.SPEED_PAY_ORDER.getRoute(), orderId, correlationData);
//    }
//
//    /**
//     * speed 代理升级
//     * @param memberId
//     */
//    public void sendAutoLevelUpTeamMsg(@NotNull Long memberId) {
//        log.info("sendAutoLevelUpTeamMsg:{}", memberId);
//        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
//        rabbitTemplate.convertAndSend(QueueEnum.SPEED_LEVEL_UP_TEAM.getExchange(), QueueEnum.SPEED_LEVEL_UP_TEAM.getRoute(), memberId, correlationData);
//    }
//
//    /**
//     * speed 代理升级
//     * @param memberId
//     */
//    public void sendAutoLevelUpMsg(@NotNull Long memberId) {
//        log.info("sendAutoLevelUpMsg:{}", memberId);
//        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
//        rabbitTemplate.convertAndSend(QueueEnum.SPEED_LEVEL_UP.getExchange(), QueueEnum.SPEED_LEVEL_UP.getRoute(), memberId, correlationData);
//    }
//
//    /**
//     * speed 直推返利
//     */
//    public void sendDirectPerkMsg(@NotNull Long memberId) {
//        log.info("sendDirectPerkMsg:{}", memberId);
//        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
//        rabbitTemplate.convertAndSend(QueueEnum.SPEED_DIRECT_PERK.getExchange(), QueueEnum.SPEED_DIRECT_PERK.getRoute(), memberId, correlationData);
//    }
//
//    /**
//     * speed 卖出资产
//     */
//    public void sendSalePackageMsg(@NotNull Long flowId) {
//        log.info("sendSalePackageMsg:{}", flowId);
//        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
//        rabbitTemplate.convertAndSend(QueueEnum.SPEED_SALE_PACKAGE.getExchange(), QueueEnum.SPEED_SALE_PACKAGE.getRoute(), flowId, correlationData);
//    }
    public void sendDitribProfit(Long id) {
        log.info("发送滑点分配消息:{}", id);
        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
        rabbitTemplate.convertAndSend(QueueEnum.DISTRIB_PROFIT.getExchange(), QueueEnum.DISTRIB_PROFIT.getRoute(), id, correlationData);
    }
    public void sendUserBuyReward(Long id) {
        log.info("发送用户购买奖励消息:{}", id);
        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
        rabbitTemplate.convertAndSend(QueueEnum.USER_BUY_REWARD.getExchange(), QueueEnum.USER_BUY_REWARD.getRoute(), id, correlationData);
    }
}