| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.gateway.GatewayUtils; |
| | | import com.fzzy.gateway.hx2023.ScConstant; |
| | | import com.fzzy.gateway.hx2023.data.WebSocketPacket; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | /** |
| | | * |
| | | * 设备恢复信息的WEBSOCKET |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | String tag = packet.getDeviceId(); |
| | | |
| | | // 遍历推送 |
| | |
| | | |
| | | packet.getHeaders().setProductId(productId); |
| | | |
| | | |
| | | log.debug("----------返回信息-----{}", packet); |
| | | |
| | | if (key.indexOf(tag) != -1) { |
| | | session = sessionPool.get(key); |
| | | session.getAsyncRemote().sendText( |
| | | JSONObject.toJSONString(packet)); |
| | | session.getAsyncRemote().sendText(JSONObject.toJSONString(packet)); |
| | | } |
| | | } |
| | | } |