Merge remote-tracking branch 'origin/master'

This commit is contained in:
董宏宇
2021-01-20 16:23:17 +08:00
14 changed files with 222 additions and 0 deletions

3
.idea/gradle.xml generated
View File

@@ -16,9 +16,12 @@
<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-tanlu" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

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,4 @@
include ':modules:mogo-tanlu'
include ':foudations:mogo-commons'
include ':foudations:mogo-httpdns'
include ':foudations:mogo-passport'