From 8f720d592d6ea2229cac4c051828af39f8425325 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Mon, 03 Jun 2024 11:45:00 +0800
Subject: [PATCH] 批量转账

---
 src/main/java/cc/mrbird/febs/rabbit/producer/ChainProducer.java |   39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/rabbit/producer/ChainProducer.java b/src/main/java/cc/mrbird/febs/rabbit/producer/ChainProducer.java
index 1efe71f..c247ee9 100644
--- a/src/main/java/cc/mrbird/febs/rabbit/producer/ChainProducer.java
+++ b/src/main/java/cc/mrbird/febs/rabbit/producer/ChainProducer.java
@@ -2,6 +2,9 @@
 
 import cc.mrbird.febs.rabbit.QueueEnum;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.AmqpException;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.core.MessagePostProcessor;
 import org.springframework.amqp.rabbit.connection.CorrelationData;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,6 +45,40 @@
     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);
+        rabbitTemplate.convertAndSend(QueueEnum.GFA_ZY_HUA_DIAN.getExchange(), QueueEnum.GFA_ZY_HUA_DIAN.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);
+    }
+
+
+    public void sendZhiYaDelayMsg(Long id, Long times) {
+        log.info("发送延时质押消息:{}, {}", id, times);
+        rabbitTemplate.convertAndSend(QueueEnum.GFA_ZY_TIME_TTL.getExchange(),
+                QueueEnum.GFA_ZY_TIME_TTL.getRoute(),
+                id, new MessagePostProcessor() {
+                    @Override
+                    public Message postProcessMessage(Message message) throws AmqpException {
+                        message.getMessageProperties().setExpiration(String.valueOf(times));
+                        return message;
+                    }
+                });
+    }
+
+
+    public void sendZhiYaDelayFlowMsg(Long id, Long times) {
+        log.info("发送延时质押流水消息:{}, {}", id, times);
+        rabbitTemplate.convertAndSend(QueueEnum.GFA_ZY_TIME_TTL_FLOW.getExchange(),
+                QueueEnum.GFA_ZY_TIME_TTL_FLOW.getRoute(),
+                id, new MessagePostProcessor() {
+                    @Override
+                    public Message postProcessMessage(Message message) throws AmqpException {
+                        message.getMessageProperties().setExpiration(String.valueOf(times));
+                        return message;
+                    }
+                });
     }
 }

--
Gitblit v1.9.1