[2.13.0-opt]remove service module and module-common
This commit is contained in:
1
modules/mogo-module-common/.gitignore
vendored
1
modules/mogo-module-common/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,80 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-android-extensions'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.alibaba.arouter'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
//ARouter apt 参数
|
||||
kapt {
|
||||
useBuildCache = false
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
res.srcDirs = [
|
||||
'src/main/res',// 默认资源目录
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
api rootProject.ext.dependencies.mogoaicloudrealtime
|
||||
|
||||
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
api rootProject.ext.dependencies.mogomap
|
||||
api rootProject.ext.dependencies.mogomapapi
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
api rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
api rootProject.ext.dependencies.mogo_core_function_call
|
||||
} else {
|
||||
api project(":libraries:mogo-map")
|
||||
api project(":libraries:mogo-map-api")
|
||||
implementation project(':libraries:mogo-adas-data')
|
||||
api project(":foudations:mogo-commons")
|
||||
api project(':services:mogo-service-api')
|
||||
api project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-data')
|
||||
api project(':core:mogo-core-function-call')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
GROUP=com.mogo.module
|
||||
POM_ARTIFACT_ID=module-common
|
||||
VERSION_CODE=1
|
||||
@@ -1,4 +0,0 @@
|
||||
<manifest package="com.mogo.module.common">
|
||||
|
||||
|
||||
</manifest>
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.mogo.module.common;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/21
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public final class MogoApisHandler {
|
||||
|
||||
private IMogoServiceApis sApis;
|
||||
|
||||
private static volatile MogoApisHandler sInstance;
|
||||
|
||||
private MogoApisHandler() {
|
||||
sApis = ARouter.getInstance().navigation( IMogoServiceApis.class );
|
||||
}
|
||||
|
||||
public static MogoApisHandler getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoApisHandler.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MogoApisHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public IMogoServiceApis getApis() {
|
||||
if ( sApis == null ) {
|
||||
synchronized ( this ) {
|
||||
if ( sApis == null ) {
|
||||
sApis = ARouter.getInstance().navigation( IMogoServiceApis.class );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sApis;
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.mogo.module.common.mock;
|
||||
|
||||
public class RealTimeData {
|
||||
|
||||
private static volatile RealTimeData realTimeData;
|
||||
private static final byte[] bytes = new byte[0];
|
||||
|
||||
private double lat;
|
||||
private double lon;
|
||||
private double heading;
|
||||
private int speed;
|
||||
private long satelliteTime;
|
||||
|
||||
private RealTimeData() {
|
||||
|
||||
}
|
||||
|
||||
public static RealTimeData getInstance() {
|
||||
if (realTimeData == null) {
|
||||
synchronized (bytes) {
|
||||
if (realTimeData == null) {
|
||||
realTimeData = new RealTimeData();
|
||||
}
|
||||
}
|
||||
}
|
||||
return realTimeData;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public void setHeading(double heading) {
|
||||
this.heading = heading;
|
||||
}
|
||||
|
||||
public void setSpeed(int speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public void setSatelliteTime(long satelliteTime) {
|
||||
this.satelliteTime = satelliteTime;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public double getHeading() {
|
||||
return heading;
|
||||
}
|
||||
|
||||
public int getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public long getSatelliteTime() {
|
||||
return satelliteTime;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.mogo.module.common.mock;
|
||||
|
||||
import com.elegant.spi.annotations.Service;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.realtime.api.IRealTimeProvider;
|
||||
import com.mogo.realtime.entity.SocketReceiveDataProto3;
|
||||
import com.mogo.realtime.util.MortonCode;
|
||||
|
||||
import static com.mogo.cloud.socket.SocketMsgType.MSG_TYPE_UPLINK_CAR_DATA;
|
||||
|
||||
@Service(value = IRealTimeProvider.class)
|
||||
public class SpiRealTimeProvider implements IRealTimeProvider {
|
||||
|
||||
@Override
|
||||
public SocketReceiveDataProto3.SocketReceiveDataProto getLocationMsg() {
|
||||
|
||||
double lat = RealTimeData.getInstance().getLat();
|
||||
double lon = RealTimeData.getInstance().getLon();
|
||||
if (lat == 0.0f || lon == 0.0f) {
|
||||
return null;
|
||||
}
|
||||
double heading = RealTimeData.getInstance().getHeading();
|
||||
int speed = RealTimeData.getInstance().getSpeed();
|
||||
long satelliteTime = RealTimeData.getInstance().getSatelliteTime();
|
||||
long mortonCode = MortonCode.encodeMorton(lon, lat);
|
||||
|
||||
SocketReceiveDataProto3.LocationInfoProto locationInfoProto =
|
||||
SocketReceiveDataProto3.LocationInfoProto.newBuilder()
|
||||
.setLat(lat)
|
||||
.setLon(lon)
|
||||
.setHeading(heading)
|
||||
.setSystemTime(System.currentTimeMillis())
|
||||
.setSatelliteTime(satelliteTime)
|
||||
.setAlt(0)
|
||||
.setDataAccuracy(1)
|
||||
.setSpeed(speed)
|
||||
.setMortonCode(mortonCode)
|
||||
.setSn(MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.build();
|
||||
|
||||
SocketReceiveDataProto3.MyLocationReq myLocationReq =
|
||||
SocketReceiveDataProto3.MyLocationReq.newBuilder()
|
||||
.setLastCoordinate(locationInfoProto)
|
||||
.setDataAccuracy(1)
|
||||
.setMortonCode(mortonCode)
|
||||
.setFromType(0)
|
||||
.setSn(MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.build();
|
||||
|
||||
SocketReceiveDataProto3.OnePerSecondSendReqProto self =
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user