From 87c7037e167ba94e858c4ae7a1d1870c4128b775 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Tue, 06 Apr 2021 16:12:33 +0800 Subject: [PATCH] Merge branch 'activity' of http://120.27.238.55:7000/r/exchange into activity --- 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