Helius
2020-08-26 5f4ba658bd9f091fe2b17cc82644e761aaf49ebf
add entrust close queue
2 files modified
16 ■■■■■ changed files
src/main/java/com/xcong/excoin/rabbit/consumer/WebsocketPriceConsumer.java 1 ●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/WholeTest.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/consumer/WebsocketPriceConsumer.java
@@ -152,6 +152,7 @@
     * @param message
     * @param channel
     */
    @RabbitListener(queues = RabbitMqConfig.QUEUE_LIMIT_CLOSE)
    public void onMessageLimitClose(Message message, Channel channel) {
        String content = new String(message.getBody());
        log.info("==message-price-consumer==我收到消息了委托平仓: {}", content);
src/test/java/com/xcong/excoin/WholeTest.java
@@ -1,7 +1,9 @@
package com.xcong.excoin;
import com.alibaba.fastjson.JSONObject;
import com.xcong.excoin.common.contants.AppContants;
import com.xcong.excoin.common.enumerates.CoinTypeEnum;
import com.xcong.excoin.common.enumerates.RabbitPriceTypeEnum;
import com.xcong.excoin.modules.contract.dao.ContractHoldOrderDao;
import com.xcong.excoin.modules.contract.entity.ContractHoldOrderEntity;
import com.xcong.excoin.modules.contract.service.RabbitOrderService;
@@ -9,6 +11,8 @@
import com.xcong.excoin.modules.member.dao.MemberWalletContractDao;
import com.xcong.excoin.modules.member.entity.MemberEntity;
import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity;
import com.xcong.excoin.rabbit.pricequeue.OrderModel;
import com.xcong.excoin.rabbit.producer.OrderProducer;
import com.xcong.excoin.utils.CalculateUtil;
import com.xcong.excoin.utils.ThreadPoolUtils;
import org.junit.jupiter.api.Test;
@@ -85,4 +89,15 @@
        System.out.println(CalculateUtil.getBondAmount(openPrice, BigDecimal.valueOf(6), 1, 5));
    }
    @Autowired
    private OrderProducer orderProducer;
    @Test
    public void sendMsg() {
        List<OrderModel> list = new ArrayList<>();
        OrderModel orderModel = new OrderModel(1L, RabbitPriceTypeEnum.ENTRUST_OPEN_MORE.getValue(), "111", "BTC");
        list.add(orderModel);
        orderProducer.sendLimitClose(JSONObject.toJSONString(list));
    }
}