| | |
| | | * |
| | | * @param vehicleNo |
| | | */ |
| | | public R startupRealVideo(Integer inferiorPlatformId, String vehicleNo) { |
| | | public R<String> startupRealVideo(Integer inferiorPlatformId, String vehicleNo) { |
| | | Channel channel = ChannelMap.getClientChannel(inferiorPlatformId); |
| | | if (!channel.isActive()) { |
| | | return R.fail("失败"); |
| | |
| | | UPExgMsgRegister exgMsgRegister = upExgMsgRegisterDao.findByVehicleNo(vehicleNo); |
| | | UPAuthorizeMsgStartup authorizeMsgStartup = upAuthorizeMsgStartupDao.findByInferiorPlatformIdOrderByCreateTimeDesc(inferiorPlatformId); |
| | | if (null == authorizeMsgStartup) { |
| | | return R.fail("获取失效口令失败"); |
| | | return R.fail("获取时效口令失败"); |
| | | } |
| | | DOWNRealvideoMsgStartup downRealvideoMsgStartup = new DOWNRealvideoMsgStartup(); |
| | | downRealvideoMsgStartup.setVehicleNo(exgMsgRegister.getVehicleNo()); |
| | |
| | | downRealvideoMsgStartup.setAuthorizeCode(authorizeMsgStartup.getAuthorizeCode1()); |
| | | downRealvideoMsgStartup.setGnssData(""); |
| | | byte[] body = downRealvideoMsgStartup.encode(); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_REALVIDEO_MSG.getCode(), body); |
| | | OuterPacket out = new OuterPacket(DataType.DOWN_REALVIDEO_MSG.getCode(), inferiorPlatformId, body); |
| | | channel.writeAndFlush(out); |
| | | log.info("发起实时音视频请求({}):{}", DataType.DOWN_REALVIDEO_MSG_STARTUP.getCode(), JSON.toJSONString(downRealvideoMsgStartup)); |
| | | return R.ok(); |
| | | return R.ok(authorizeMsgStartup.getAuthorizeCode1()); |
| | | } |
| | | |
| | | } |