[2.13.0-arch-opt] add note

This commit is contained in:
zhongchao
2023-01-14 14:24:23 +08:00
parent 63d9459352
commit 245bde74d2
6 changed files with 9 additions and 310 deletions

View File

@@ -6,18 +6,13 @@ import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.data.v2x.V2XOptimalRouteDataRes;
import com.mogo.eagle.core.function.call.chat.CallerChatManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
import com.mogo.eagle.core.function.v2x.events.utils.TestOnLineCarUtils;
import com.mogo.eagle.core.function.v2x.events.utils.V2XSQLiteUtils;
import com.mogo.eagle.core.utilcode.util.Utils;
import java.util.List;
@@ -57,10 +52,6 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
// 存储本地,出行动态作展示
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING,
v2XMessageEntity.getContent().getNoveltyInfo());
} else if (sceneType == 10) {//触发事件UGC
V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity =
TestOnLineCarUtils.getV2XScenarioRoadEventUGCData();
@@ -102,17 +93,4 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
}
}
/**
* 存储本地数据
*
* @param v2XRoadEventEntity 要存储的场景
*/
public void saveLocalStory(int scenarioType, MarkerExploreWay v2XRoadEventEntity) {
try {
V2XSQLiteUtils.saveLocalStory(scenarioType, v2XRoadEventEntity, v2XRoadEventEntity.hashCode());
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -1,185 +0,0 @@
package com.mogo.eagle.core.function.v2x.events.utils;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
import com.mogo.eagle.core.data.map.entity.V2XEventZanData;
import com.mogo.eagle.core.data.map.entity.V2XHistoryScenarioData;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.sqlite.SQLIDao;
import com.mogo.eagle.core.utilcode.util.TimeUtils;
import com.mogo.eagle.core.utilcode.util.Utils;
import com.mogo.utils.sqlite.SQLDaoFactory;
import java.util.List;
/**
* 数据库操作工具类
*
* @author donghongyu
*/
public class V2XSQLiteUtils {
/**
* 场景数据管理
*/
private static SQLIDao<V2XHistoryScenarioData> mScenarioHistoryDao;
/**
* 点赞数据管理
*/
private static SQLIDao<V2XEventZanData> mV2XEventZanDao;
/**
* 点赞数据管理
*/
public static SQLIDao<V2XEventZanData> getV2XEventZanDao() {
if (mV2XEventZanDao == null) {
synchronized (V2XSQLiteUtils.class) {
if (mV2XEventZanDao == null) {
mV2XEventZanDao = SQLDaoFactory.Companion.getInstance()
.getBaseDao(Utils.getApp(), V2XEventZanData.class);
}
}
}
return mV2XEventZanDao;
}
/**
* 存储本地数据
*
* @param v2XEventZanData 要存储的场景
*/
public static void saveEventZanLocalStory(V2XEventZanData v2XEventZanData) {
try {
if (!isZanEvent(v2XEventZanData.eventId)) {
// 进行数据库存储
V2XSQLiteUtils.getV2XEventZanDao().insert(v2XEventZanData);
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 判断是否已经存在
*
* @param eventId 要判断的事件ID
* @return true-已存在false-没存在
*/
public static boolean isZanEvent(String eventId) {
try {
// 查询数据库,判断是否存在
for (V2XEventZanData eventZanDatum : getEventZanData()) {
if (eventZanDatum.eventId.equals(eventId)) {
return true;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
/**
* 查询当天的V2X数据
*/
public static List<V2XEventZanData> getEventZanData() {
return getV2XEventZanDao().query(new V2XEventZanData());
}
/**
* 修改指定的数据
*/
public static void updateScenarioHistoryData(V2XHistoryScenarioData oldScenarioData, V2XHistoryScenarioData newScenarioData) {
try {
int result = getScenarioHistoryDao().update(oldScenarioData, newScenarioData);
//V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 场景数据管理
*/
public static SQLIDao<V2XHistoryScenarioData> getScenarioHistoryDao() {
if (mScenarioHistoryDao == null) {
synchronized (V2XSQLiteUtils.class) {
if (mScenarioHistoryDao == null) {
mScenarioHistoryDao = SQLDaoFactory.Companion.getInstance()
.getBaseDao(Utils.getApp(), V2XHistoryScenarioData.class);
}
}
}
return mScenarioHistoryDao;
}
/**
* 查询当天的V2X数据
*/
public static List<V2XHistoryScenarioData> getScenarioHistoryData() {
return getScenarioHistoryDao().query(new V2XHistoryScenarioData(), "triggerTime", true);
}
/**
* 删除数据库中存储的昨天的数据
*/
public static void clearYesterdayScenarioHistoryData() {
try {
List<V2XHistoryScenarioData> historyScenarioData = getScenarioHistoryDao().query(new V2XHistoryScenarioData());
for (V2XHistoryScenarioData historyScenarioDatum : historyScenarioData) {
Long triggerTime = historyScenarioDatum.getTriggerTime();
if (!TimeUtils.isToday(triggerTime)) {
int result = getScenarioHistoryDao().delete(historyScenarioDatum);
if (result > 0) {
CallerLogger.INSTANCE.d(M_V2X + "V2XSQLiteUtils", "删除过期数据成功");
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 存储本地数据,每个数据只能存在一次,所以存储之前先查询数据库如果已经存在则修改触碰时间
*
* @param markerExploreWay 要存储的场景
*/
public static void saveLocalStory(int scenarioType, Object markerExploreWay, int hashCode) {
try {
CallerLogger.INSTANCE.d(M_V2X + "V2XSQLiteUtils", "saveLocalStory" + markerExploreWay);
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(scenarioType);
v2XHistoryScenarioData.setEventJsonDataHashCode(hashCode);
List<V2XHistoryScenarioData> historyScenarioData = getTargetScenarioHistoryData(v2XHistoryScenarioData);
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(markerExploreWay));
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
v2XHistoryScenarioData.setDispose(false);
if (historyScenarioData != null && historyScenarioData.size() > 0) {
// 更新数据
V2XSQLiteUtils.getScenarioHistoryDao().update(historyScenarioData.get(0), v2XHistoryScenarioData);
} else {
// 存储新数据
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
}
//V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 查询当天的指定的V2X数据
*/
public static List<V2XHistoryScenarioData> getTargetScenarioHistoryData(V2XHistoryScenarioData scenarioData) {
return getScenarioHistoryDao().query(scenarioData, "triggerTime", true);
}
}

View File

@@ -1,70 +0,0 @@
2023-01-14 12:03:02.263 24403-24598/com.mogo.launcher.f D/com.zhidao.socket--->: start socket
2023-01-14 12:03:02.754 24403-24403/com.mogo.launcher.f D/com.zhidao.socket--->: requestSocketAddress onGetSocketAddressSuccess 0:OK
2023-01-14 12:03:02.754 24403-24403/com.mogo.launcher.f D/com.zhidao.socket--->: internalStart-->host: 119.45.249.167 & port: 11000
2023-01-14 12:03:02.773 24403-24403/com.mogo.launcher.f D/com.zhidao.socket--->: start connect 119.45.249.167:11000
2023-01-14 12:03:02.773 24403-24403/com.mogo.launcher.f D/com.zhidao.socket--->: doConnection
2023-01-14 12:03:03.934 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: Client---connecting server succeeds
2023-01-14 12:03:03.937 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: call login
2023-01-14 12:03:03.938 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: checkNotNull(channel), channel is not null.
2023-01-14 12:03:03.938 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: socket connected is :false
2023-01-14 12:03:03.944 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: socket app id is dataCrawler, msg type is 531
2023-01-14 12:03:03.960 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: login
2023-01-14 12:03:03.960 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: ---onConnectSuccess
2023-01-14 12:03:03.962 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: channel is active
2023-01-14 12:03:03.994 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: Client---client receive server---MogoConnsvrPacket{magicCode=28007, payloadOffset=11, packetLength=270, header=UnpooledSlicedByteBuf(ridx: 0, widx: 3, cap: 3/3, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 270, widx: 270, cap: 1024)), payload=UnpooledSlicedByteBuf(ridx: 0, widx: 259, cap: 259/259, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 270, widx: 270, cap: 1024))}
2023-01-14 12:03:03.995 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: receive server---msgTypemogoMsgTypeConnSvrAuthMidRsp
2023-01-14 12:03:04.001 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: call checkAuth
2023-01-14 12:03:04.001 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: checkNotNull(channel), channel is not null.
2023-01-14 12:03:04.001 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: socket connected is :false
2023-01-14 12:03:04.002 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: socket app id is dataCrawler, msg type is 533
2023-01-14 12:03:04.004 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: checkAuth
2023-01-14 12:03:04.038 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: Client---client receive server---MogoConnsvrPacket{magicCode=28007, payloadOffset=11, packetLength=11, header=UnpooledSlicedByteBuf(ridx: 0, widx: 3, cap: 3/3, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 11, widx: 11, cap: 1024)), payload=UnpooledSlicedByteBuf(ridx: 0, widx: 0, cap: 0/0, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 11, widx: 11, cap: 1024))}
2023-01-14 12:03:04.038 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: receive server---msgTypemogoMsgTypeConnSvrAuthRsp
2023-01-14 12:03:04.040 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: Client authority check succeeded
2023-01-14 12:03:04.044 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: setExact(...)
2023-01-14 12:03:04.044 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: call send user info
2023-01-14 12:03:04.044 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: checkNotNull(channel), channel is not null.
2023-01-14 12:03:04.044 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: socket connected is :false
2023-01-14 12:03:04.048 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: socket app id is dataCrawler, msg type is 529
2023-01-14 12:03:04.050 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: send user info
2023-01-14 12:03:04.082 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: Client---client receive server---MogoConnsvrPacket{magicCode=28007, payloadOffset=11, packetLength=13, header=UnpooledSlicedByteBuf(ridx: 0, widx: 3, cap: 3/3, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 13, widx: 13, cap: 512)), payload=UnpooledSlicedByteBuf(ridx: 0, widx: 2, cap: 2/2, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 13, widx: 13, cap: 512))}
2023-01-14 12:03:04.082 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: receive server---msgTypemogoMsgTypeConnSvrAgentInfoRsp
2023-01-14 12:03:04.084 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: Client receives server's user info response, result is true.
2023-01-14 12:04:44.088 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: channel is inactive, it depends on client's choice whether to reconnect or not.
2023-01-14 12:04:44.089 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: close allowReconnect=true
2023-01-14 12:04:44.089 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: channel is null
2023-01-14 12:04:44.090 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: heartbeat alarm is cancelled
2023-01-14 12:04:44.090 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: ---onConnectLost
2023-01-14 12:04:44.092 24403-24641/com.mogo.launcher.f D/com.zhidao.socket--->: retryGetAddress 1000
2023-01-14 12:04:45.092 24403-24403/com.mogo.launcher.f D/com.zhidao.socket--->: get socket address
2023-01-14 12:04:50.321 24403-24403/com.mogo.launcher.f D/com.zhidao.socket--->: requestSocketAddress onGetSocketAddressSuccess 0:OK
2023-01-14 12:04:50.321 24403-24403/com.mogo.launcher.f D/com.zhidao.socket--->: internalStart-->host: 119.45.249.167 & port: 11000
2023-01-14 12:04:50.324 24403-24403/com.mogo.launcher.f D/com.zhidao.socket--->: start connect 119.45.249.167:11000
2023-01-14 12:04:50.324 24403-24403/com.mogo.launcher.f D/com.zhidao.socket--->: doConnection
2023-01-14 12:04:51.413 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: Client---connecting server succeeds
2023-01-14 12:04:51.414 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: call login
2023-01-14 12:04:51.416 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: checkNotNull(channel), channel is not null.
2023-01-14 12:04:51.416 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: socket connected is :false
2023-01-14 12:04:51.416 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: socket app id is dataCrawler, msg type is 531
2023-01-14 12:04:51.419 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: login
2023-01-14 12:04:51.419 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: ---onConnectSuccess
2023-01-14 12:04:51.420 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: channel is active
2023-01-14 12:04:51.443 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: Client---client receive server---MogoConnsvrPacket{magicCode=28007, payloadOffset=11, packetLength=270, header=UnpooledSlicedByteBuf(ridx: 0, widx: 3, cap: 3/3, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 270, widx: 270, cap: 1024)), payload=UnpooledSlicedByteBuf(ridx: 0, widx: 259, cap: 259/259, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 270, widx: 270, cap: 1024))}
2023-01-14 12:04:51.443 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: receive server---msgTypemogoMsgTypeConnSvrAuthMidRsp
2023-01-14 12:04:51.445 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: call checkAuth
2023-01-14 12:04:51.445 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: checkNotNull(channel), channel is not null.
2023-01-14 12:04:51.445 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: socket connected is :false
2023-01-14 12:04:51.446 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: socket app id is dataCrawler, msg type is 533
2023-01-14 12:04:51.451 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: checkAuth
2023-01-14 12:04:51.477 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: Client---client receive server---MogoConnsvrPacket{magicCode=28007, payloadOffset=11, packetLength=11, header=UnpooledSlicedByteBuf(ridx: 0, widx: 3, cap: 3/3, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 11, widx: 11, cap: 1024)), payload=UnpooledSlicedByteBuf(ridx: 0, widx: 0, cap: 0/0, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 11, widx: 11, cap: 1024))}
2023-01-14 12:04:51.477 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: receive server---msgTypemogoMsgTypeConnSvrAuthRsp
2023-01-14 12:04:51.477 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: Client authority check succeeded
2023-01-14 12:04:51.480 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: setExact(...)
2023-01-14 12:04:51.480 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: call send user info
2023-01-14 12:04:51.480 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: checkNotNull(channel), channel is not null.
2023-01-14 12:04:51.480 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: socket connected is :false
2023-01-14 12:04:51.481 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: socket app id is dataCrawler, msg type is 529
2023-01-14 12:04:51.482 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: send user info
2023-01-14 12:04:51.509 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: Client---client receive server---MogoConnsvrPacket{magicCode=28007, payloadOffset=11, packetLength=13, header=UnpooledSlicedByteBuf(ridx: 0, widx: 3, cap: 3/3, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 13, widx: 13, cap: 512)), payload=UnpooledSlicedByteBuf(ridx: 0, widx: 2, cap: 2/2, unwrapped: UnpooledByteBufAllocator$InstrumentedUnpooledHeapByteBuf(ridx: 13, widx: 13, cap: 512))}
2023-01-14 12:04:51.509 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: receive server---msgTypemogoMsgTypeConnSvrAgentInfoRsp
2023-01-14 12:04:51.509 24403-24852/com.mogo.launcher.f D/com.zhidao.socket--->: Client receives server's user info response, result is true.