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 |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 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 6ab2c54..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;
@@ -38,4 +41,44 @@
         CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
         rabbitTemplate.convertAndSend(QueueEnum.ONLINE_TRANSFER.getExchange(), QueueEnum.ONLINE_TRANSFER.getRoute(), batchNo, correlationData);
     }
+
+    public void sendDitribProfit(Long id) {
+        log.info("发送滑点分配消息:{}", id);
+        CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
+        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