diff --git a/.idea/gradle.xml b/.idea/gradle.xml index ba4f62c..11c551e 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -16,9 +16,12 @@ 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..fa3ca3c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,4 @@ +include ':modules:mogo-tanlu' include ':foudations:mogo-commons' include ':foudations:mogo-httpdns' include ':foudations:mogo-passport'