From 829f629756e5402bcd3e9f6ef1f9c6dbffbabb11 Mon Sep 17 00:00:00 2001 From: KKSU <15274802129@163.com> Date: Wed, 17 Apr 2024 14:46:29 +0800 Subject: [PATCH] 55测试环境 --- src/main/java/com/xcong/excoin/rabbit/producer/FollowProducer.java | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/xcong/excoin/rabbit/producer/FollowProducer.java b/src/main/java/com/xcong/excoin/rabbit/producer/FollowProducer.java index cecb098..a29ab8f 100644 --- a/src/main/java/com/xcong/excoin/rabbit/producer/FollowProducer.java +++ b/src/main/java/com/xcong/excoin/rabbit/producer/FollowProducer.java @@ -1,13 +1,20 @@ package com.xcong.excoin.rabbit.producer; +import com.alibaba.fastjson.JSONObject; import com.xcong.excoin.configurations.RabbitMqConfig; +import com.xcong.excoin.modules.contract.parameter.dto.ChangeBondDto; import lombok.extern.slf4j.Slf4j; +import net.sf.json.JSON; import org.springframework.amqp.rabbit.connection.CorrelationData; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.web3j.abi.datatypes.Int; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; import java.util.UUID; /** @@ -41,4 +48,16 @@ log.info("发送跟单下单消息: {}, {}", id, correlationData.getId()); rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_A, RabbitMqConfig.ROUTINGKEY_FOLLOW_ORDER, id.toString(), correlationData); } + + /** + * 发送跟单调整保证金信息 + * + * @param id + */ + public void sendChangeFollowOrderBond(ChangeBondDto changeBondDto) { + CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); + String msg = JSONObject.toJSONString(changeBondDto); + log.info("发送跟单保证金调整消息: {}, {}", msg, correlationData.getId()); + rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_A, RabbitMqConfig.ROUTINGKEY_FOLLOW_CHANGE_BOND, msg, correlationData); + } } -- Gitblit v1.9.1