500ms上报数据增加cityCode

This commit is contained in:
tongchenfei
2020-12-20 11:22:50 +08:00
parent 47b81cc7e1
commit 3188d585d5
3 changed files with 24 additions and 3 deletions

View File

@@ -16,6 +16,8 @@ public class WebSocketData implements Serializable {
private long upUtcTime;
private String cityCode;
public long getSeq() {
return seq;
}
@@ -63,4 +65,12 @@ public class WebSocketData implements Serializable {
public void setUpUtcTime(long upUtcTime) {
this.upUtcTime = upUtcTime;
}
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
}

View File

@@ -8,6 +8,7 @@ import androidx.annotation.Keep;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.mogo.commons.network.Utils;
import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.service.connection.IMogoMsgAckListener;
import com.mogo.service.connection.IMogoOnWebSocketMessageListener;
@@ -140,15 +141,20 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
webSocketData.setMsgType(listener.getUpLinkType().getMsgType());
webSocketData.setSn(Utils.getSn());
webSocketData.setData(GsonUtil.jsonFromObject(body));
MogoLocation lastKnown = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(context).getLastKnowLocation();
if (lastKnown != null) {
webSocketData.setCityCode(lastKnown.getCityCode());
}
String msg = GsonUtil.jsonFromObject(webSocketData);
Logger.d(TAG,"sendMsg : " + msg);
handlerThread.sendMsg(msg);
}
}
private Context context;
@Override
public void init(Context context) {
this.context = context;
}
@Override