Merge remote-tracking branch 'origin/master'

# Conflicts:
#	foudations/mogo-commons/build.gradle
This commit is contained in:
wujifei
2021-01-20 17:03:47 +08:00
29 changed files with 359 additions and 58 deletions

4
.idea/gradle.xml generated
View File

@@ -16,6 +16,10 @@
<option value="$PROJECT_DIR$/foudations/mogo-commons" />
<option value="$PROJECT_DIR$/foudations/mogo-httpdns" />
<option value="$PROJECT_DIR$/foudations/mogo-passport" />
<option value="$PROJECT_DIR$/modules" />
<option value="$PROJECT_DIR$/modules/mogo-realtime" />
<option value="$PROJECT_DIR$/modules/mogo-tanlu" />
<option value="$PROJECT_DIR$/modules/realtime" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />

View File

@@ -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 {

View File

@@ -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",
]
}

View File

@@ -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
}

View File

@@ -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)
}
}

View File

@@ -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)
}
}

View File

@@ -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()

View File

@@ -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')

View File

@@ -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;
}

1
modules/mogo-realtime/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

View File

@@ -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'
}

View File

View File

@@ -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

View File

@@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@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());
}
}

View File

@@ -0,0 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mogo_realtime">
/
</manifest>

View File

@@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

1
modules/mogo-tanlu/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

View File

@@ -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
}

View File

21
modules/mogo-tanlu/proguard-rules.pro vendored Normal file
View File

@@ -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

View File

@@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@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());
}
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.tanlu">
</manifest>

View File

@@ -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<TanluMarkerExploreWay> data;
public List<TanluMarkerExploreWay> getData() {
return data;
}
public void setData(List<TanluMarkerExploreWay> data) {
this.data = data;
}
}

View File

@@ -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 {
}

View File

@@ -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 +
'}';
}
}

View File

@@ -0,0 +1,10 @@
package com.mogo.tanlu.constant;
/**
* @author lixiaopeng
* @description
* @since 2021/1/20
*/
public class HttpConstant {
}

View File

@@ -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<BaseDataCompat<RoadInfos>> queryRoadInfos(@FieldMap Map<String, Object> params);
Observable<RoadInfos> queryRoadInfos(@FieldMap Map<String, Object> params);
//上报情报数据
@FormUrlEncoded
@POST("/deva/car/path/no/addInfomation/v2")
Observable<UploadResult> uploadInformation(@FieldMap Map<String, String> information);
}

View File

@@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@@ -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'