| | |
| | | @ResponseBody |
| | | @PostMapping("/sendMsgToClient") |
| | | public String sendMsgToClient(Integer id, Integer type, String msg){ |
| | | System.out.println("推送参数:" + id + "---" + type + "---" + msg); |
| | | if(type == 1){//用户端 |
| | | ChannelHandlerContext channel = NettyChannelMap.getData("Applets" + id);//小程序 |
| | | if(null != channel){ |
| | |
| | | } |
| | | |
| | | if(type == 2){//司机端 |
| | | System.out.println("长链接实例:" + JSON.toJSONString(NettyChannelMap.map)); |
| | | ChannelHandlerContext channel = NettyChannelMap.getData("DRIVER" + id); |
| | | if(null != channel){ |
| | | nettyServerController.sendMsgToClient(channel, msg); |