From d23645e976981bc9b670eea1d469fe8a36be309c Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Wed, 17 Apr 2024 17:19:53 +0800
Subject: [PATCH] 55测试环境
---
src/main/java/com/xcong/excoin/rabbit/consumer/FollowConsumer.java | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/rabbit/consumer/FollowConsumer.java b/src/main/java/com/xcong/excoin/rabbit/consumer/FollowConsumer.java
index d206b1b..e7fc215 100644
--- a/src/main/java/com/xcong/excoin/rabbit/consumer/FollowConsumer.java
+++ b/src/main/java/com/xcong/excoin/rabbit/consumer/FollowConsumer.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.Channel;
import com.xcong.excoin.configurations.RabbitMqConfig;
+import com.xcong.excoin.modules.contract.parameter.dto.ChangeBondDto;
import com.xcong.excoin.modules.documentary.service.FollowOrderOperationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
@@ -35,14 +36,11 @@
followOrderOperationService.addFollowerOrder(Long.parseLong(content));
}
-// @RabbitListener(queues = RabbitMqConfig.QUEUE_FOLLOW_CHANGE_BOND)
+ @RabbitListener(queues = RabbitMqConfig.QUEUE_FOLLOW_CHANGE_BOND)
public void changeFollowOrderBond(Message message, Channel channel) {
String content = new String(message.getBody());
log.info("==收到跟单保证金调整消息 : {}", content);
- Map map = JSONObject.parseObject(content, Map.class);
- Integer id = (Integer) map.get("id");
- BigDecimal bond = (BigDecimal) map.get("bond");
- Integer type = (Integer) map.get("type");
- followOrderOperationService.changeFollowOrdersBond(id.longValue(), bond, type);
+ ChangeBondDto changeBondDto = JSONObject.parseObject(content, ChangeBondDto.class);
+ followOrderOperationService.changeFollowOrdersBond(changeBondDto.getId(), changeBondDto.getAmount(), changeBondDto.getType());
}
}
--
Gitblit v1.9.1