diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index ba4f62c..2c52dd3 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -16,6 +16,10 @@
+
+
+
+
diff --git a/app/build.gradle b/app/build.gradle
index e6d9c80..b71e1a2 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -11,6 +11,11 @@ android {
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+
+ packagingOptions {
+ //解决编译时com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'META-INF/rxjava.properties'这个错误
+ exclude 'META-INF/rxjava.properties'
+ }
}
buildTypes {
diff --git a/config.gradle b/config.gradle
index 4566169..bc07a04 100644
--- a/config.gradle
+++ b/config.gradle
@@ -10,7 +10,7 @@ ext {
dependencies = [
// androidx
androidxappcompat : "androidx.appcompat:appcompat:1.1.0",
- androidxccorektx : "androidx.core:core-ktx:1.3.0",
+ androidxccorektx : "androidx.core:core-ktx:1.3.2",
androidxconstraintlayout : "androidx.constraintlayout:constraintlayout:1.1.3",
boostmultidex : "com.bytedance.boost_multidex:boost_multidex:1.0.1",
androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0",
@@ -55,9 +55,9 @@ ext {
// 公司服务 - 埋点
analytics : "com.elegant.analytics:analytics:1.1.28",
- retrofit : "com.squareup.retrofit2:retrofit:2.6.0",
- retrofitadapter : "com.squareup.retrofit2:adapter-rxjava2:2.6.0",
- retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.6.0",
+ retrofit : "com.squareup.retrofit2:retrofit:2.1.0",
+ retrofitadapter : "com.squareup.retrofit2:adapter-rxjava2:2.1.0",
+ retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.1.0",
retrofitconverterscalars : "com.squareup.retrofit2:converter-scalars:2.1.0",
@@ -116,6 +116,10 @@ ext {
androidxroomruntime : "androidx.room:room-runtime:2.2.3",
androidxroomcompiler : "androidx.room:room-compiler:2.2.3",
androidxroomktx : "androidx.room:room-ktx:2.2.3",
+
+ mogoutils : "com.mogo.commons:mogo-utils:2.0.12",
+
+
]
}
\ No newline at end of file
diff --git a/foudations/mogo-commons/build.gradle b/foudations/mogo-commons/build.gradle
index 28e905a..6bbcf78 100644
--- a/foudations/mogo-commons/build.gradle
+++ b/foudations/mogo-commons/build.gradle
@@ -27,17 +27,16 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
- implementation 'androidx.core:core-ktx:1.1.0'
- implementation 'androidx.appcompat:appcompat:1.1.0'
- implementation project(path: ':foudations:mogo-passport')
- testImplementation 'junit:junit:4.12'
- androidTestImplementation 'androidx.test.ext:junit:1.1.1'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ implementation rootProject.ext.dependencies.androidxccorektx
+ implementation rootProject.ext.dependencies.androidxappcompat
+
api rootProject.ext.dependencies.retrofit
api rootProject.ext.dependencies.retrofitadapter
api rootProject.ext.dependencies.retrofitconvertergson
api rootProject.ext.dependencies.retrofitconverterscalars
-
implementation project(path: ':foudations:mogo-httpdns')
+ implementation project(path: ':foudations:mogo-passport')
+
implementation rootProject.ext.dependencies.okhttpinterceptor
}
\ No newline at end of file
diff --git a/foudations/mogo-commons/src/androidTest/java/com/mogo/cloud/commons/ExampleInstrumentedTest.kt b/foudations/mogo-commons/src/androidTest/java/com/mogo/cloud/commons/ExampleInstrumentedTest.kt
deleted file mode 100644
index 229aaf7..0000000
--- a/foudations/mogo-commons/src/androidTest/java/com/mogo/cloud/commons/ExampleInstrumentedTest.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.mogo.cloud.commons
-
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.ext.junit.runners.AndroidJUnit4
-
-import org.junit.Test
-import org.junit.runner.RunWith
-
-import org.junit.Assert.*
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-@RunWith(AndroidJUnit4::class)
-class ExampleInstrumentedTest {
- @Test
- fun useAppContext() {
- // Context of the app under test.
- val appContext = InstrumentationRegistry.getInstrumentation().targetContext
- assertEquals("com.mogo.cloud.commons.test", appContext.packageName)
- }
-}
\ No newline at end of file
diff --git a/foudations/mogo-commons/src/test/java/com/mogo/cloud/commons/ExampleUnitTest.kt b/foudations/mogo-commons/src/test/java/com/mogo/cloud/commons/ExampleUnitTest.kt
deleted file mode 100644
index b8f9ed0..0000000
--- a/foudations/mogo-commons/src/test/java/com/mogo/cloud/commons/ExampleUnitTest.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.mogo.cloud.commons
-
-import org.junit.Test
-
-import org.junit.Assert.*
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-class ExampleUnitTest {
- @Test
- fun addition_isCorrect() {
- assertEquals(4, 2 + 2)
- }
-}
\ No newline at end of file
diff --git a/foudations/mogo-httpdns/build.gradle b/foudations/mogo-httpdns/build.gradle
index b2fcc3b..15a91d3 100644
--- a/foudations/mogo-httpdns/build.gradle
+++ b/foudations/mogo-httpdns/build.gradle
@@ -33,12 +33,9 @@ android {
}
dependencies {
-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
- implementation 'androidx.core:core-ktx:1.3.2'
- implementation 'androidx.appcompat:appcompat:1.2.0'
- implementation 'com.google.android.material:material:1.2.1'
-
+ implementation rootProject.ext.dependencies.androidxccorektx
+ implementation rootProject.ext.dependencies.androidxappcompat
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
\ No newline at end of file
diff --git a/foudations/mogo-passport/build.gradle b/foudations/mogo-passport/build.gradle
index 1c76b2c..333563c 100644
--- a/foudations/mogo-passport/build.gradle
+++ b/foudations/mogo-passport/build.gradle
@@ -29,7 +29,7 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation rootProject.ext.dependencies.androidxappcompat
-
+ api rootProject.ext.dependencies.mogoutils
// passport
implementation 'com.zhidao.tcloginsdk:tclogin:1.1.5.1'
api project(path: ':foudations:mogo-httpdns')
diff --git a/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java b/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java
index 9838a30..02c17fa 100644
--- a/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java
+++ b/foudations/mogo-passport/src/main/java/com/mogo/cloud/passport/MoGoAiCloudClientConfig.java
@@ -1,11 +1,15 @@
package com.mogo.cloud.passport;
+import android.text.TextUtils;
+
import com.mogo.cloud.httpdns.MogoHttpDnsConfig;
+import com.mogo.utils.logger.Logger;
/**
* SDK 中的参数
*/
public class MoGoAiCloudClientConfig {
+ private static final String TAG = "MoGoAiCloudClientConfig";
/**
* 网络模式
@@ -104,10 +108,16 @@ public class MoGoAiCloudClientConfig {
}
public String getToken() {
+ if (TextUtils.isEmpty(token)) {
+ Logger.e(TAG, "Token 获取失败……");
+ }
return token;
}
public String getSn() {
+ if (TextUtils.isEmpty(sn)) {
+ Logger.e(TAG, "SN 获取失败……");
+ }
return sn;
}
diff --git a/modules/mogo-realtime/.gitignore b/modules/mogo-realtime/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/modules/mogo-realtime/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/modules/mogo-realtime/build.gradle b/modules/mogo-realtime/build.gradle
new file mode 100644
index 0000000..d969b5b
--- /dev/null
+++ b/modules/mogo-realtime/build.gradle
@@ -0,0 +1,32 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ minSdkVersion 16
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles "consumer-rules.pro"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: "libs", include: ["*.jar"])
+ implementation 'androidx.appcompat:appcompat:1.1.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+}
\ No newline at end of file
diff --git a/modules/mogo-realtime/consumer-rules.pro b/modules/mogo-realtime/consumer-rules.pro
new file mode 100644
index 0000000..e69de29
diff --git a/modules/mogo-realtime/proguard-rules.pro b/modules/mogo-realtime/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/modules/mogo-realtime/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/modules/mogo-realtime/src/androidTest/java/com/example/mogo_realtime/ExampleInstrumentedTest.java b/modules/mogo-realtime/src/androidTest/java/com/example/mogo_realtime/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..9da1d7d
--- /dev/null
+++ b/modules/mogo-realtime/src/androidTest/java/com/example/mogo_realtime/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.mogo_realtime;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.mogo_realtime.test", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-realtime/src/main/AndroidManifest.xml b/modules/mogo-realtime/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..e7882dd
--- /dev/null
+++ b/modules/mogo-realtime/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+ /
+
\ No newline at end of file
diff --git a/modules/mogo-realtime/src/test/java/com/example/mogo_realtime/ExampleUnitTest.java b/modules/mogo-realtime/src/test/java/com/example/mogo_realtime/ExampleUnitTest.java
new file mode 100644
index 0000000..915a031
--- /dev/null
+++ b/modules/mogo-realtime/src/test/java/com/example/mogo_realtime/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.mogo_realtime;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-tanlu/.gitignore b/modules/mogo-tanlu/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/modules/mogo-tanlu/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/modules/mogo-tanlu/build.gradle b/modules/mogo-tanlu/build.gradle
new file mode 100644
index 0000000..64d7d15
--- /dev/null
+++ b/modules/mogo-tanlu/build.gradle
@@ -0,0 +1,43 @@
+plugins {
+ id 'com.android.library'
+}
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.3"
+
+ defaultConfig {
+ minSdkVersion 26
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles "consumer-rules.pro"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.2.1'
+ testImplementation 'junit:junit:4.+'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+
+ implementation rootProject.ext.dependencies.retrofit
+ implementation rootProject.ext.dependencies.retrofitconvertergson
+ implementation rootProject.ext.dependencies.gson
+ implementation rootProject.ext.dependencies.rxjava
+}
\ No newline at end of file
diff --git a/modules/mogo-tanlu/consumer-rules.pro b/modules/mogo-tanlu/consumer-rules.pro
new file mode 100644
index 0000000..e69de29
diff --git a/modules/mogo-tanlu/proguard-rules.pro b/modules/mogo-tanlu/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/modules/mogo-tanlu/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/modules/mogo-tanlu/src/androidTest/java/com/mogo/tanlu/ExampleInstrumentedTest.java b/modules/mogo-tanlu/src/androidTest/java/com/mogo/tanlu/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..b8d4a9e
--- /dev/null
+++ b/modules/mogo-tanlu/src/androidTest/java/com/mogo/tanlu/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.mogo.tanlu;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.mogo.tanlu.test", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/modules/mogo-tanlu/src/main/AndroidManifest.xml b/modules/mogo-tanlu/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..2120c43
--- /dev/null
+++ b/modules/mogo-tanlu/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/bean/RoadInfos.java b/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/bean/RoadInfos.java
new file mode 100644
index 0000000..281559b
--- /dev/null
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/bean/RoadInfos.java
@@ -0,0 +1,21 @@
+package com.mogo.tanlu.bean;
+
+import java.util.List;
+
+/**
+ * @author lixiaopeng
+ * @description
+ * @since 2021/1/20
+ */
+public class RoadInfos {
+
+ private List data;
+
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+}
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/bean/TanluMarkerExploreWay.java b/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/bean/TanluMarkerExploreWay.java
new file mode 100644
index 0000000..8a904f0
--- /dev/null
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/bean/TanluMarkerExploreWay.java
@@ -0,0 +1,12 @@
+package com.mogo.tanlu.bean;
+
+import java.io.Serializable;
+
+/**
+ * @author lixiaopeng
+ * @description
+ * @since 2021/1/20
+ */
+public class TanluMarkerExploreWay implements Serializable {
+
+}
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/bean/UploadResult.java b/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/bean/UploadResult.java
new file mode 100644
index 0000000..7c6631a
--- /dev/null
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/bean/UploadResult.java
@@ -0,0 +1,27 @@
+package com.mogo.tanlu.bean;
+
+import java.io.Serializable;
+
+/**
+ * @author lixiaopeng
+ * @description
+ * @since 2021/1/20
+ */
+public class UploadResult implements Serializable {
+ public long id;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ @Override
+ public String toString() {
+ return "UploadResult{" +
+ "id=" + id +
+ '}';
+ }
+}
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/constant/HttpConstant.java b/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/constant/HttpConstant.java
new file mode 100644
index 0000000..1354ca4
--- /dev/null
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/constant/HttpConstant.java
@@ -0,0 +1,10 @@
+package com.mogo.tanlu.constant;
+
+/**
+ * @author lixiaopeng
+ * @description
+ * @since 2021/1/20
+ */
+public class HttpConstant {
+
+}
diff --git a/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/net/TanluApiService.java b/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/net/TanluApiService.java
new file mode 100644
index 0000000..5514fa9
--- /dev/null
+++ b/modules/mogo-tanlu/src/main/java/com/mogo/tanlu/net/TanluApiService.java
@@ -0,0 +1,35 @@
+package com.mogo.tanlu.net;
+
+import com.mogo.tanlu.bean.RoadInfos;
+import com.mogo.tanlu.bean.UploadResult;
+
+import java.util.Map;
+
+import io.reactivex.Observable;
+import retrofit2.http.FieldMap;
+import retrofit2.http.FormUrlEncoded;
+import retrofit2.http.POST;
+
+/**
+ * @author lixiaopeng
+ * @description
+ * @since 2021/1/20
+ */
+public interface TanluApiService {
+ /**
+ * 查询(搜索)道路事件信息
+ * 接口文档:http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=42305842
+ * 文档中有些参数暂时没有用到,包括radius,limit
+ * @return
+ */
+ @FormUrlEncoded
+ @POST("/yycp-launcherSnapshot/launcherSnapshot/searchRoadEventsSync")
+// Observable> queryRoadInfos(@FieldMap Map params);
+ Observable queryRoadInfos(@FieldMap Map params);
+
+ //上报情报数据
+ @FormUrlEncoded
+ @POST("/deva/car/path/no/addInfomation/v2")
+ Observable uploadInformation(@FieldMap Map information);
+
+}
diff --git a/modules/mogo-tanlu/src/test/java/com/mogo/tanlu/ExampleUnitTest.java b/modules/mogo-tanlu/src/test/java/com/mogo/tanlu/ExampleUnitTest.java
new file mode 100644
index 0000000..6e1b89c
--- /dev/null
+++ b/modules/mogo-tanlu/src/test/java/com/mogo/tanlu/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.mogo.tanlu;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index 9cc457f..4f9565d 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,3 +1,6 @@
+include ':modules:mogo-realtime'
+include ':modules:realtime'
+include ':modules:mogo-tanlu'
include ':foudations:mogo-commons'
include ':foudations:mogo-httpdns'
include ':foudations:mogo-passport'