| | |
| | | import com.xiaopeng.api.feignClient.automaticPilot.VmpOpenServiceClient; |
| | | import com.xiaopeng.api.feignClient.automaticPilot.XPUClient; |
| | | import com.xiaopeng.api.vo.automaticPilot.MqttPublishVo; |
| | | import com.xiaopeng.api.vo.automaticPilot.protobuf.RTCmdType; |
| | | import com.xiaopeng.api.vo.automaticPilot.protobuf.RtTaskList; |
| | | import com.xiaopeng.api.vo.automaticPilot.protobuf.*; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.utils.uuid.UUID; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | */ |
| | | //TODO 处理feign调用的异常 |
| | | public MqttPublishDto cloudCreateOrder(RtTaskList taskList, String vin, Long sequence) { |
| | | com.xiaopeng.api.vo.automaticPilot.protobuf.MsgContent.Builder msgContentBuilder = com.xiaopeng.api.vo.automaticPilot.protobuf.MsgContent.newBuilder(); |
| | | com.xiaopeng.api.vo.automaticPilot.protobuf.MsgHeader.Builder headerBuilder = com.xiaopeng.api.vo.automaticPilot.protobuf.MsgHeader.newBuilder(); |
| | | MsgContent.Builder msgContentBuilder = MsgContent.newBuilder(); |
| | | MsgHeader.Builder headerBuilder = MsgHeader.newBuilder(); |
| | | headerBuilder.setMsgId(UUID.randomUUID().toString()); |
| | | headerBuilder.setTimestamp(System.currentTimeMillis()); |
| | | headerBuilder.setCmd(RTCmdType.CLOUD_CREATE_ORDER.getValue()); |
| | | headerBuilder.setSequence(sequence); |
| | | headerBuilder.setType(com.xiaopeng.api.vo.automaticPilot.protobuf.MessageType.MESSAGE_TYPE_REQUEST); |
| | | headerBuilder.setSource(com.xiaopeng.api.vo.automaticPilot.protobuf.SourceType.CLOUD); |
| | | headerBuilder.setType(MessageType.MESSAGE_TYPE_REQUEST); |
| | | headerBuilder.setSource(SourceType.CLOUD); |
| | | msgContentBuilder.setHeader(headerBuilder.build()); |
| | | |
| | | msgContentBuilder.setRtTaskList(taskList); |
| | |
| | | * @return |
| | | */ |
| | | //TODO 处理feign调用的异常 |
| | | public MqttPublishDto cloudOrderOperation(com.xiaopeng.api.vo.automaticPilot.protobuf.OrderOperation operation, String vin, Long sequence) { |
| | | com.xiaopeng.api.vo.automaticPilot.protobuf.MsgContent.Builder msgContentBuilder = com.xiaopeng.api.vo.automaticPilot.protobuf.MsgContent.newBuilder(); |
| | | com.xiaopeng.api.vo.automaticPilot.protobuf.MsgHeader.Builder headerBuilder = com.xiaopeng.api.vo.automaticPilot.protobuf.MsgHeader.newBuilder(); |
| | | public MqttPublishDto cloudOrderOperation(OrderOperation operation, String vin, Long sequence) { |
| | | MsgContent.Builder msgContentBuilder = MsgContent.newBuilder(); |
| | | MsgHeader.Builder headerBuilder = MsgHeader.newBuilder(); |
| | | headerBuilder.setMsgId(UUID.randomUUID().toString()); |
| | | headerBuilder.setTimestamp(System.currentTimeMillis()); |
| | | headerBuilder.setCmd(RTCmdType.CLOUD_ORDER_OPERATION.getValue()); |
| | | headerBuilder.setSequence(sequence); |
| | | headerBuilder.setType(com.xiaopeng.api.vo.automaticPilot.protobuf.MessageType.MESSAGE_TYPE_REQUEST); |
| | | headerBuilder.setSource(com.xiaopeng.api.vo.automaticPilot.protobuf.SourceType.CLOUD); |
| | | headerBuilder.setType(MessageType.MESSAGE_TYPE_REQUEST); |
| | | headerBuilder.setSource(SourceType.CLOUD); |
| | | msgContentBuilder.setHeader(headerBuilder.build()); |
| | | |
| | | msgContentBuilder.setOrderOperation(operation); |
| | |
| | | * @param responseMessage |
| | | * @return |
| | | */ |
| | | public MqttPublishDto responseMessage(com.xiaopeng.api.vo.automaticPilot.protobuf.ResponseMessage responseMessage, String vin) { |
| | | com.xiaopeng.api.vo.automaticPilot.protobuf.MsgContent.Builder msgContentBuilder = com.xiaopeng.api.vo.automaticPilot.protobuf.MsgContent.newBuilder(); |
| | | com.xiaopeng.api.vo.automaticPilot.protobuf.MsgHeader.Builder headerBuilder = com.xiaopeng.api.vo.automaticPilot.protobuf.MsgHeader.newBuilder(); |
| | | public MqttPublishDto responseMessage(ResponseMessage responseMessage, String vin) { |
| | | MsgContent.Builder msgContentBuilder = MsgContent.newBuilder(); |
| | | MsgHeader.Builder headerBuilder = MsgHeader.newBuilder(); |
| | | headerBuilder.setMsgId(UUID.randomUUID().toString()); |
| | | headerBuilder.setTimestamp(System.currentTimeMillis()); |
| | | headerBuilder.setCmd(RTCmdType.CLOUD_TASK_CONTROL.getValue()); |
| | | Snowflake snowflake = IdUtil.getSnowflake(0, 0); |
| | | headerBuilder.setSequence(snowflake.nextId()); |
| | | headerBuilder.setType(com.xiaopeng.api.vo.automaticPilot.protobuf.MessageType.MESSAGE_TYPE_RESPONSE); |
| | | headerBuilder.setSource(com.xiaopeng.api.vo.automaticPilot.protobuf.SourceType.CLOUD); |
| | | headerBuilder.setType(MessageType.MESSAGE_TYPE_RESPONSE); |
| | | headerBuilder.setSource(SourceType.CLOUD); |
| | | msgContentBuilder.setHeader(headerBuilder.build()); |
| | | msgContentBuilder.setResponse(responseMessage); |
| | | MqttPublishVo vo = new MqttPublishVo(); |
| | |
| | | * @return |
| | | */ |
| | | //TODO 处理feign调用的异常 |
| | | public MqttPublishDto cloudPushNavigation(com.xiaopeng.api.vo.automaticPilot.protobuf.RestoreNavigationData navigationData, String xpuId, Long sequence) { |
| | | com.xiaopeng.api.vo.automaticPilot.protobuf.MsgContent.Builder msgContentBuilder = com.xiaopeng.api.vo.automaticPilot.protobuf.MsgContent.newBuilder(); |
| | | com.xiaopeng.api.vo.automaticPilot.protobuf.MsgHeader.Builder headerBuilder = com.xiaopeng.api.vo.automaticPilot.protobuf.MsgHeader.newBuilder(); |
| | | public MqttPublishDto cloudPushNavigation(RestoreNavigationData navigationData, String xpuId, Long sequence) { |
| | | MsgContent.Builder msgContentBuilder = MsgContent.newBuilder(); |
| | | MsgHeader.Builder headerBuilder = MsgHeader.newBuilder(); |
| | | headerBuilder.setMsgId(UUID.randomUUID().toString()); |
| | | headerBuilder.setTimestamp(System.currentTimeMillis()); |
| | | headerBuilder.setCmd(RTCmdType.CLOUD_NAVIGATION_RESPONSE.getValue()); |
| | | headerBuilder.setSequence(sequence); |
| | | headerBuilder.setType(com.xiaopeng.api.vo.automaticPilot.protobuf.MessageType.MESSAGE_TYPE_RESPONSE); |
| | | headerBuilder.setSource(com.xiaopeng.api.vo.automaticPilot.protobuf.SourceType.CLOUD); |
| | | headerBuilder.setType(MessageType.MESSAGE_TYPE_RESPONSE); |
| | | headerBuilder.setSource(SourceType.CLOUD); |
| | | msgContentBuilder.setHeader(headerBuilder.build()); |
| | | |
| | | msgContentBuilder.setRestoreNavigationData(navigationData); |