| | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | }*/ |
| | | |
| | | WebSocketSession webSocketSession = new WebSocketSession(session, getTimeInMillis(), type, param); |
| | | // 加入set中 |
| | |
| | | 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,不推送消息"); |