From f8a0008705fd8067959151ce83c5dce19e72fb85 Mon Sep 17 00:00:00 2001 From: zainali5120 <512061637@qq.com> Date: Sat, 10 Oct 2020 17:42:49 +0800 Subject: [PATCH] golden交易所分布式支持 --- src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java b/src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java index 2b836cf..a8e174e 100644 --- a/src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/coin/service/impl/OrderCoinServiceImpl.java @@ -17,6 +17,7 @@ import com.xcong.excoin.modules.platform.entity.PlatformSymbolsCoinEntity; import com.xcong.excoin.modules.symbols.constants.SymbolsConstats; +import com.xcong.excoin.rabbit.producer.OrderSubmitProducer; import com.xcong.excoin.trade.CoinTrader; import com.xcong.excoin.trade.CoinTraderFactory; import com.xcong.excoin.trade.ExchangeTrade; @@ -91,6 +92,9 @@ @Resource private MemberDao memberDao; + + @Resource + private OrderSubmitProducer orderSubmitProducer; @Override @@ -465,9 +469,11 @@ // memberWalletCoinDao.updateById(walletCoin); memberWalletCoinDao.updateWalletBalance(walletCoin.getId(),amount.negate(),amount.negate(),amount); } - // 加入到撮合 - CoinTrader trader = factory.getTrader(symbol); - trader.trade(order); + // 加入到撮合 TODO 通过消息队列发送到交易撮合 + //CoinTrader trader = factory.getTrader(symbol); + //trader.trade(order); + order.setSymbol(symbol); + orderSubmitProducer.sendMsg(JSONObject.toJSONString(order)); return Result.ok(MessageSourceUtils.getString("order_service_0011")); } -- Gitblit v1.9.1