| | |
| | | public void onMessage(String message, Session session) { |
| | | // 盘口订阅方法 {sub: 'market.btcusdt.depth.10,id: symbol} |
| | | JSONObject jsonObject = JSON.parseObject(message); |
| | | // log.info("订阅参数:{}", jsonObject); |
| | | // 盘口的判断 |
| | | if (jsonObject.containsKey("sub") && jsonObject.get("sub").toString().contains("depth")) { |
| | | |
| | |
| | | // 发送订阅消息 |
| | | String nekk = factory.getTrader(SymbolsConstats.ROC).sendTradePlateMessage(); |
| | | SubResultModel subResultModel = new SubResultModel(); |
| | | subResultModel.setId("rocusdt"); |
| | | subResultModel.setId("beausdt"); |
| | | subResultModel.setSubbed(sub); |
| | | synchronized (session) { |
| | | try { |
| | |
| | | String key = "KINE_{}_{}"; |
| | | // 币币k线数据 |
| | | //key = StrUtil.format(key, symbol, period); |
| | | key = StrUtil.format(key, "ROC/USDT", period); |
| | | key = StrUtil.format(key, "BEA/USDT", period); |
| | | RedisUtils bean = SpringContextHolder.getBean(RedisUtils.class); |
| | | Object o = bean.get(key); |
| | | List<CandlestickModel> candlestickModels = new ArrayList<>(); |