zainali5120
2020-09-20 3ffaa6bf323862a3770897d4e934baf98d324c47
src/main/java/com/xcong/excoin/websocket/TradePlateSendWebSocket.java
@@ -6,6 +6,7 @@
import com.alibaba.fastjson.JSONObject;
import com.huobi.client.model.Candlestick;
import com.xcong.excoin.common.contants.AppContants;
import com.xcong.excoin.modules.symbols.constants.SymbolsConstats;
import com.xcong.excoin.trade.CoinTraderFactory;
import com.xcong.excoin.utils.CoinTypeConvert;
import com.xcong.excoin.utils.RedisUtils;
@@ -82,6 +83,7 @@
        JSONObject jsonObject = JSON.parseObject(message);
        // 盘口的判断
        if (jsonObject.containsKey("sub") && jsonObject.get("sub").toString().contains("depth")) {
            String sub = jsonObject.get("sub").toString();
            String symbol = sub.split("\\.")[1];
            symbol = CoinTypeConvert.convert(symbol);
@@ -95,9 +97,9 @@
            // 发送一次盘口
            CoinTraderFactory factory = SpringContextHolder.getBean(CoinTraderFactory.class);
            // 发送订阅消息
            String nekk = factory.getTrader("NEKK").sendTradePlateMessage();
            String nekk = factory.getTrader(SymbolsConstats.ROC).sendTradePlateMessage();
            SubResultModel subResultModel = new SubResultModel();
            subResultModel.setId("nekkusdt");
            subResultModel.setId("rocusdt");
            subResultModel.setSubbed(sub);
            synchronized (session){
                try {
@@ -188,7 +190,7 @@
            String key = "KINE_{}_{}";
            // 币币k线数据
            //key = StrUtil.format(key, symbol, period);
            key = StrUtil.format(key, "NEKK/USDT", period);
            key = StrUtil.format(key, "ROC/USDT", period);
            RedisUtils bean = SpringContextHolder.getBean(RedisUtils.class);
            Object o = bean.get(key);
            List<CandlestickModel> candlestickModels = new ArrayList<>();