新版仿ok交易所-后端
peter
2025-10-13 e69a57d95f9c85be977f0429394e3dc82cc55129
trading-order-admin/src/main/java/com/yami/trading/api/websocket/WebSocketServer.java
@@ -47,7 +47,7 @@
   public void onOpen(@PathParam(value = "type") String type,
                       @PathParam(value = "param") String param, Session session) {
      //停牌断开连接
      if (WebSocketEnum.SOCKET_ENUM_DEPTH.getCode().equals(type)) {
      /*if (WebSocketEnum.SOCKET_ENUM_DEPTH.getCode().equals(type)) {
         List<Item> items = ApplicationContextUtils.getApplicationContext().getBean(ItemService.class).list();
         if (CollectionUtil.isNotEmpty(items)) {
            Item item = items.stream().filter(i -> param.equalsIgnoreCase(i.getSymbol())).findFirst().orElse(null);
@@ -58,7 +58,7 @@
            }
         }
      }
      }*/
      WebSocketSession webSocketSession = new WebSocketSession(session,  getTimeInMillis(), type, param);
      // 加入set中
@@ -138,6 +138,7 @@
      try {
         if (WebSocketEnum.SOCKET_ENUM_REALTIME.getCode().equals(type)) {
            if (realtimeMap.get(key) != null) {
               realtimeMap.get(key).sendMessage(message);
            } else {
               System.out.println("realtimeMap中没有此key,不推送消息");