From bbbd0bb2a74f39af7ab213ea3a7cde1e211fe430 Mon Sep 17 00:00:00 2001
From: zainali5120 <512061637@qq.com>
Date: Wed, 11 Nov 2020 23:57:29 +0800
Subject: [PATCH] 修改redis配置
---
src/main/java/com/xcong/excoin/rabbit/consumer/UsdtUpdateConsumer.java | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/rabbit/consumer/UsdtUpdateConsumer.java b/src/main/java/com/xcong/excoin/rabbit/consumer/UsdtUpdateConsumer.java
index 2e375be..62c25c7 100644
--- a/src/main/java/com/xcong/excoin/rabbit/consumer/UsdtUpdateConsumer.java
+++ b/src/main/java/com/xcong/excoin/rabbit/consumer/UsdtUpdateConsumer.java
@@ -3,9 +3,11 @@
import com.alibaba.fastjson.JSONObject;
import com.xcong.excoin.configurations.RabbitMqConfig;
import com.xcong.excoin.modules.blackchain.model.EthUsdtChargeDto;
+import com.xcong.excoin.modules.blackchain.service.UsdtErc20UpdateService;
import com.xcong.excoin.modules.coin.service.BlockCoinService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@@ -16,6 +18,7 @@
**/
@Slf4j
@Component
+@ConditionalOnProperty(prefix = "app", name = "block-job", havingValue = "true")
public class UsdtUpdateConsumer {
@@ -25,9 +28,17 @@
@RabbitListener(queues = RabbitMqConfig.QUEUE_USDT_UPDATE)
public void doSomething(String content) {
- log.info("#---->{}#", content);
+ log.info("#USDT同步---->{}#", content);
EthUsdtChargeDto ethUsdtChargeDto = JSONObject.parseObject(content, EthUsdtChargeDto.class);
// 更新这个用户的余额
blockCoinService.updateEthUsdtNew(ethUsdtChargeDto);
}
+
+ @RabbitListener(queues = RabbitMqConfig.QUEUE_USDT_ADDRESS)
+ public void addUsdtAddress(String content) {
+ if(!UsdtErc20UpdateService.ALL_ADDRESS_LIST.contains(content)){
+ log.debug("#添加新地址---->{}#", content);
+ UsdtErc20UpdateService.ALL_ADDRESS_LIST.add(content);
+ }
+ }
}
--
Gitblit v1.9.1