| | |
| | | |
| | | 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; |
| | |
| | | * |
| | | * @param id |
| | | */ |
| | | public void sendChangeFollowOrderBond(Long id, BigDecimal changeBond, Integer type) { |
| | | public void sendChangeFollowOrderBond(ChangeBondDto changeBondDto) { |
| | | CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", id); |
| | | map.put("bond", changeBond); |
| | | map.put("type", type); |
| | | String msg = JSONObject.toJSONString(map); |
| | | String msg = JSONObject.toJSONString(changeBondDto); |
| | | log.info("发送跟单保证金调整消息: {}, {}", msg, correlationData.getId()); |
| | | rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_A, RabbitMqConfig.ROUTINGKEY_FOLLOW_CHANGE_BOND, msg, correlationData); |
| | | } |