| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/sendMsgToClient") |
| | | public String sendMsgToClient(Integer id, Integer type, String msg){ |
| | | if(type == 1){//用户端 |
| | | public String sendMsgToClient(String id, String type, String msg){ |
| | | if("1".equals(type)){//用户端 |
| | | ChannelHandlerContext channel = NettyChannelMap.getData("Applets" + id);//小程序 |
| | | if(null != channel){ |
| | | NettyWebSocketController.sendMsgToClient(channel, msg); |
| | |
| | | |
| | | } |
| | | |
| | | if(type == 2){//司机端 |
| | | if("2".equals(type)){//司机端 |
| | | ChannelHandlerContext channel = NettyChannelMap.getData("DRIVER" + id); |
| | | if(null != channel){ |
| | | NettyServerController.sendMsgToClient(channel, msg); |