add mock data upload

This commit is contained in:
zhongchao
2021-06-15 11:55:05 +08:00
parent 9b4277ec99
commit 38da4123f8
9 changed files with 28 additions and 34 deletions

View File

@@ -3,8 +3,6 @@ package com.mogo.cloud;
import com.elegant.spi.annotations.Service;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.realtime.api.IRealTimeProvider;
import com.mogo.realtime.entity.DataCollectMsgDataProto;
import com.mogo.realtime.entity.DataCollectWrapper;
import com.mogo.realtime.entity.SocketReceiveDataProto3;
import com.mogo.realtime.util.MortonCode;
@@ -20,7 +18,7 @@ import static com.mogo.cloud.socket.SocketMsgType.MSG_TYPE_UPLINK_CAR_DATA;
class SPIRealTimeTestClass implements IRealTimeProvider {
@Override
public DataCollectWrapper.DataCollectMsg getLocationMsg() {
public SocketReceiveDataProto3.SocketReceiveDataProto getLocationMsg() {
long mortonCode = MortonCode.encodeMorton(116.410871, 39.968309);
@@ -43,7 +41,7 @@ class SPIRealTimeTestClass implements IRealTimeProvider {
.setLastCoordinate(locationInfoProto)
.setDataAccuracy(1)
.setMortonCode(mortonCode)
.setFromType(1)
.setFromType(0)
.setSn(MoGoAiCloudClientConfig.getInstance().getSn())
.build();
@@ -51,15 +49,12 @@ class SPIRealTimeTestClass implements IRealTimeProvider {
SocketReceiveDataProto3.OnePerSecondSendReqProto.newBuilder()
.setSelf(myLocationReq)
.build();
return SocketReceiveDataProto3.SocketReceiveDataProto.newBuilder()
.setIPCSn(MoGoAiCloudClientConfig.getInstance().getSn() + "xavier")
.setSn(MoGoAiCloudClientConfig.getInstance().getSn())
.setData(self)
.setMsgType(MSG_TYPE_UPLINK_CAR_DATA.getMsgType())
.setSeq(System.currentTimeMillis()).build();
DataCollectMsgDataProto.DataCollectMsgData msgData =
DataCollectMsgDataProto.DataCollectMsgData.newBuilder()
.setPayload(self.toByteString())
.setMsgType(MSG_TYPE_UPLINK_CAR_DATA.getMsgType())
.build();
return DataCollectWrapper.DataCollectMsg.newBuilder()
.setData(msgData.toByteString())
.setTimestamp(System.currentTimeMillis()).build();
}
}