Merge branch 'master' of http://gitlab.zhidaoauto.com/ecos/app/MoGoAiCloudSdk
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -23,7 +23,6 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@@ -8,8 +8,6 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.realtime.core.SnapshotUploadInTime;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
|
||||
import java.nio.Buffer;
|
||||
|
||||
@@ -32,18 +30,13 @@ public class RealTimeActivity extends AppCompatActivity {
|
||||
snapshotStartButton = findViewById(R.id.snapshotStart);
|
||||
snapshotStartButton.setOnClickListener(view -> {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isNeedUploadCoordinatesDurationInTime()) {
|
||||
// SnapshotUploadInTime.getInstance().start(getApplicationContext(), "com.mogo.launcher", new IMogoCloudOnMsgListener() {
|
||||
// @Override
|
||||
// public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
SnapshotUploadInTime.getInstance().start(getApplicationContext(), "com.mogo.launcher");
|
||||
}
|
||||
});
|
||||
|
||||
snapshotStopButton = findViewById(R.id.snapshotStart);
|
||||
snapshotStopButton = findViewById(R.id.snapshotStop);
|
||||
snapshotStopButton.setOnClickListener(view -> {
|
||||
// SnapshotUploadInTime.getInstance().stop();
|
||||
SnapshotUploadInTime.getInstance().stop();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.mogo.realtime.Interface.RealTimeProvider;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
import com.zhidao.utils.common.SystemUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,6 +32,16 @@ class SPIRealTimeTestClass implements RealTimeProvider {
|
||||
|
||||
@Override
|
||||
public List<CloudLocationInfo> getLocationMsg() {
|
||||
return null;
|
||||
List<CloudLocationInfo> list = null;
|
||||
CloudLocationInfo info = new CloudLocationInfo();
|
||||
info.setAlt(55);
|
||||
info.setLat(39.968309);
|
||||
info.setLon(116.410871);
|
||||
info.setSatelliteTime(System.currentTimeMillis());
|
||||
info.setSystemTime(System.currentTimeMillis());
|
||||
info.setHeading(120);
|
||||
info.setSpeed(7.0);
|
||||
list.add(info);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,30 +58,28 @@ public class NetworkActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
tvResult.setText("结果显示");
|
||||
// queryRoadData("ZD802C1938L10797");
|
||||
queryRoadData("ZD802C1938L10797");
|
||||
// queryHelpSignal("ZD802C1938L10797");
|
||||
|
||||
//上报路况到服务端
|
||||
uploadRoadInfo();
|
||||
// uploadRoadInfo();
|
||||
//查询路况
|
||||
// queryRoad();
|
||||
}
|
||||
});
|
||||
|
||||
AtomicInteger atomicInteger = new AtomicInteger();
|
||||
atomicInteger.addAndGet(10);
|
||||
atomicInteger.getAndIncrement();
|
||||
atomicInteger.incrementAndGet();
|
||||
|
||||
}
|
||||
|
||||
public void queryRoad() {
|
||||
MogoRoadSearchManager.getInstance(NetworkActivity.this).init();
|
||||
MogoRoadSearchManager.getInstance(NetworkActivity.this).queryRoadInfo(null , new IRoadInfoSearchCallback() {
|
||||
MogoRoadSearchManager.getInstance(NetworkActivity.this).queryRoadInfo(null, new IRoadInfoSearchCallback() {
|
||||
@Override
|
||||
public void onSuccess(RoadInfos result) {
|
||||
if (result != null && result.getData() != null) {
|
||||
Log.d(TAG, "NetworkActivity queryRoad size() = " + result.getData().size());
|
||||
public void onSuccess(BaseData<RoadInfos> result) {
|
||||
if (result != null && result.getResult() != null) {
|
||||
Log.d(TAG, "msg = " + result.getMsg() + " --code =" + result.getCode());
|
||||
if (result.getResult().getData() != null) {
|
||||
Log.d(TAG, "NetworkActivity queryRoad size() = " + result.getResult().getData().size());
|
||||
}
|
||||
tvResult.setText(new Gson().toJson(result));
|
||||
}
|
||||
}
|
||||
@@ -101,21 +99,22 @@ public class NetworkActivity extends AppCompatActivity {
|
||||
public void uploadRoadInfo() {
|
||||
// MogoUploadManager.getInstance(NetworkActivity.this).init();
|
||||
|
||||
UploadInfo info = new UploadInfo();
|
||||
|
||||
List<String> filePath = new ArrayList<>();
|
||||
filePath.add("/storage/emulated/0/Movies/compress_video_20210126174432.mp4");
|
||||
filePath.add("/data/user/0/com.mogo.launcher.f/Thumbnail1611654285824.jpg");
|
||||
info.setFilePath(filePath);
|
||||
|
||||
info.setAddr("北京市东城区小黄庄北街2号靠近中国银行");
|
||||
info.setLongitude(116.410892);
|
||||
info.setLatitude(39.968317);
|
||||
info.setPoiType("10007");
|
||||
info.setDirection(0);
|
||||
info.setAreaCode("110101");
|
||||
info.setCityCode("010");
|
||||
|
||||
// UploadInfo info = new UploadInfo();
|
||||
//
|
||||
// List<String> filePath = new ArrayList<>();
|
||||
// filePath.add("/storage/emulated/0/Movies/compress_video_20210126174432.mp4");
|
||||
// filePath.add("/data/user/0/com.mogo.launcher.f/Thumbnail1611654285824.jpg");
|
||||
// info.setFilePath(filePath);
|
||||
//
|
||||
// info.setAddr("北京市东城区小黄庄北街2号靠近中国银行");
|
||||
// info.setLongitude(116.410892);
|
||||
// info.setLatitude(39.968317);
|
||||
// info.setPoiType("10007");
|
||||
// info.setDirection(0);
|
||||
// info.setAreaCode("110101");
|
||||
// info.setCityCode("010");
|
||||
// info.setSn("F803EB2046PZD00228");
|
||||
//
|
||||
// MogoUploadManager.getInstance(NetworkActivity.this).uploadInfo(info, new ITanluUploadCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(UploadResult result) {
|
||||
@@ -135,11 +134,11 @@ public class NetworkActivity extends AppCompatActivity {
|
||||
// });
|
||||
|
||||
UploadManager.getInstance(NetworkActivity.this).init();
|
||||
UploadManager.getInstance(NetworkActivity.this).loadUpload(null,new ITanluUploadCallback() {
|
||||
UploadManager.getInstance(NetworkActivity.this).loadUpload(null, new ITanluUploadCallback() {
|
||||
@Override
|
||||
public void onSuccess(UploadResult result) {
|
||||
Log.d(TAG, "NetworkActivity uploadRoadInfo result.id = " + result.id);
|
||||
tvResult.setText("onSuccess - " + result.id + "");
|
||||
public void onSuccess(BaseData<UploadResult> result) {
|
||||
Log.d(TAG, "NetworkActivity uploadRoadInfo result.id = " + result.getResult().id);
|
||||
tvResult.setText(result.getResult().id + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,6 +18,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="开启实时数据上传" />
|
||||
android:text="结束实时数据上传" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.cloud.commons.network
|
||||
|
||||
import android.text.TextUtils
|
||||
import com.mogo.cloud.commons.utils.getInetAddressByHost
|
||||
import okhttp3.Dns
|
||||
import java.net.InetAddress
|
||||
|
||||
/**
|
||||
* created by wujifei on 2021/1/26 12:51
|
||||
* describe:
|
||||
*/
|
||||
class HttpDns : Dns {
|
||||
override fun lookup(hostname: String): List<InetAddress> {
|
||||
val addresses: List<InetAddress> = getInetAddressByHost(hostname)
|
||||
if (!addresses.isEmpty()) {
|
||||
return addresses
|
||||
}
|
||||
return Dns.SYSTEM.lookup(hostname)
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.mogo.cloud.commons.network
|
||||
import com.mogo.cloud.commons.network.NetConstants.Companion.CONNECT_TIMEOUT
|
||||
import com.mogo.cloud.commons.network.NetConstants.Companion.READ_TIMEOUT
|
||||
import com.mogo.cloud.commons.network.NetConstants.Companion.WRITE_TIMEOUT
|
||||
import com.mogo.cloud.commons.network.SSLSocketFactoryUtils.createSSLSocketFactory
|
||||
import com.mogo.cloud.commons.network.SSLSocketFactoryUtils.createTrustAllManager
|
||||
import com.mogo.cloud.commons.network.interceptor.HeaderNetworkInterceptor
|
||||
import com.mogo.cloud.commons.utils.lookup
|
||||
import okhttp3.Dns
|
||||
@@ -24,18 +26,13 @@ class OkHttpFactory private constructor() {
|
||||
OkHttpClient.Builder()
|
||||
.addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
|
||||
.addNetworkInterceptor(HeaderNetworkInterceptor())
|
||||
.sslSocketFactory(createSSLSocketFactory(), createTrustAllManager())
|
||||
.hostnameVerifier(SSLSocketFactoryUtils.TrustAllHostnameVerifier())
|
||||
.connectTimeout(CONNECT_TIMEOUT, TimeUnit.MILLISECONDS)
|
||||
.readTimeout(READ_TIMEOUT, TimeUnit.MILLISECONDS)
|
||||
.writeTimeout(WRITE_TIMEOUT, TimeUnit.MILLISECONDS)
|
||||
.dns { hostname: String? ->
|
||||
val addresses: List<InetAddress?>? = lookup(hostname)
|
||||
addresses?.let {
|
||||
if (!it.isEmpty()) {
|
||||
return@dns addresses
|
||||
}
|
||||
}
|
||||
Dns.SYSTEM.lookup(hostname)
|
||||
}.build()
|
||||
.dns(HttpDns())
|
||||
.build()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.mogo.cloud.commons.network
|
||||
|
||||
import java.security.SecureRandom
|
||||
import java.security.cert.CertificateException
|
||||
import java.security.cert.X509Certificate
|
||||
import javax.net.ssl.*
|
||||
|
||||
/**
|
||||
* created by wujifei on 2021/1/26 12:51
|
||||
* describe:
|
||||
*/
|
||||
object SSLSocketFactoryUtils {
|
||||
/*
|
||||
* 默认信任所有的证书
|
||||
* 最好加上证书认证,主流App都有自己的证书
|
||||
* */
|
||||
private const val str = "TLS"
|
||||
fun createSSLSocketFactory(): SSLSocketFactory? {
|
||||
var sslSocketFactory: SSLSocketFactory? = null
|
||||
try {
|
||||
val sslContext = SSLContext.getInstance(str)
|
||||
sslContext.init(null, arrayOf<TrustManager?>(createTrustAllManager()), SecureRandom())
|
||||
sslSocketFactory = sslContext.socketFactory
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
return sslSocketFactory
|
||||
}
|
||||
|
||||
fun createTrustAllManager(): X509TrustManager? {
|
||||
var tm: X509TrustManager? = null
|
||||
try {
|
||||
tm = object : X509TrustManager {
|
||||
@Throws(CertificateException::class)
|
||||
override fun checkClientTrusted(chain: Array<X509Certificate>, authType: String) {
|
||||
//do nothing,接受任意客户端证书
|
||||
}
|
||||
|
||||
@Throws(CertificateException::class)
|
||||
override fun checkServerTrusted(chain: Array<X509Certificate>, authType: String) {
|
||||
//do nothing,接受任意服务端证书
|
||||
}
|
||||
|
||||
override fun getAcceptedIssuers(): Array<X509Certificate?> {
|
||||
return arrayOfNulls(0)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
return tm
|
||||
}
|
||||
|
||||
class TrustAllHostnameVerifier : HostnameVerifier {
|
||||
override fun verify(hostname: String, session: SSLSession): Boolean {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,4 +27,22 @@ fun lookup(hostname: String?): List<InetAddress?>? {
|
||||
} else {
|
||||
Arrays.asList(*InetAddress.getAllByName(cacheIp))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据host获取InetAddress
|
||||
*/
|
||||
@Throws(UnknownHostException::class)
|
||||
fun getInetAddressByHost(hostname: String): List<InetAddress> {
|
||||
val cacheIp: String? = hostname?.let { MogoHttpDnsClient.getHttpDnsAddressUseCacheIfNecessary(HTTP_DNS_ADDRESS_TYPE_HTTP, it) }
|
||||
if (cacheIp == null || TextUtils.isEmpty(cacheIp)) {
|
||||
return emptyList<InetAddress>()
|
||||
}
|
||||
val info = cacheIp.split(":").toTypedArray()
|
||||
return if (info.size > 1) {
|
||||
Arrays.asList(*InetAddress.getAllByName(info[0]))
|
||||
} else {
|
||||
Arrays.asList(*InetAddress.getAllByName(cacheIp))
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import android.util.Log;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mogo.cloud.commons.network.BaseData;
|
||||
import com.mogo.cloud.tanlu.api.ITanluUploadCallback;
|
||||
import com.mogo.cloud.tanlu.bean.InformationBody;
|
||||
import com.mogo.cloud.tanlu.bean.UploadInfo;
|
||||
@@ -14,6 +15,8 @@ import com.zhidao.cosupload.callback.CosStatusCallback;
|
||||
import com.zhidao.cosupload.callback.CosStatusCallbackManager;
|
||||
import com.zhidao.cosupload.manager.CosUploadManagerImpl;
|
||||
|
||||
import static com.mogo.cloud.tanlu.utils.TanluUtils.isVideo;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
@@ -85,10 +88,16 @@ public class CosUpload implements CosStatusCallback {
|
||||
// Log.d(TAG, "uploadCosCompleted 分享成功 ---- mType = $mType");
|
||||
// }
|
||||
|
||||
if (isVideo(localPath)) { //如果是视频 TODO
|
||||
|
||||
} else {
|
||||
sendInformation();
|
||||
}
|
||||
|
||||
//TODO
|
||||
mCosVideoUrl = downloadUrl;
|
||||
|
||||
sendInformation();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,8 +114,8 @@ public class CosUpload implements CosStatusCallback {
|
||||
private void sendInformation() {
|
||||
UploadManager.getInstance(mContext.getApplicationContext()).loadUpload(getInformation(), new ITanluUploadCallback() {
|
||||
@Override
|
||||
public void onSuccess(UploadResult result) {
|
||||
Log.d(TAG, "uploadRoadInfo result.id = " + result.id);
|
||||
public void onSuccess(BaseData<UploadResult> result) {
|
||||
Log.d(TAG, "uploadRoadInfo result.id = " + result.getResult().id);
|
||||
mCallback.onSuccess(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.mogo.cloud.commons.network.BaseData;
|
||||
import com.mogo.cloud.commons.network.RetrofitFactory;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.tanlu.api.IRoadInfoSearchCallback;
|
||||
@@ -64,35 +65,35 @@ public class MogoRoadSearchManager {
|
||||
* @param callback
|
||||
*/
|
||||
public void queryRoadInfo(RoadInfoRequest roadInfoRequest, IRoadInfoSearchCallback callback) {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add("10007");
|
||||
|
||||
//北京市朝阳区小黄庄北街2号
|
||||
Location location = new Location();
|
||||
location.setLatitude(39.968139);
|
||||
location.setLongitude(116.411468);
|
||||
RoadInfoRequest request = new RoadInfoRequest(location, "", list, false, false);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sn", "F803EB2046PZD00228");
|
||||
map.put("data", GsonUtil.jsonFromObject(request));
|
||||
|
||||
// ArrayList list = new ArrayList();
|
||||
// list.add("10007");
|
||||
//
|
||||
// //北京市朝阳区小黄庄北街2号
|
||||
// Location location = new Location();
|
||||
// location.setLatitude(39.968139);
|
||||
// location.setLongitude(116.411468);
|
||||
// RoadInfoRequest request = new RoadInfoRequest(location, "", list, false, false);
|
||||
//
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
// map.put("sn", MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn());
|
||||
// map.put("data", GsonUtil.jsonFromObject(roadInfoRequest));
|
||||
// map.put("sn", "F803EB2046PZD00228");
|
||||
// map.put("data", GsonUtil.jsonFromObject(request));
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sn", MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn());
|
||||
map.put("data", GsonUtil.jsonFromObject(roadInfoRequest));
|
||||
|
||||
apiService.queryRoadInfos(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<RoadInfos>() {
|
||||
.subscribe(new Observer<BaseData<RoadInfos>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.d(TAG, "queryRoadInfos onSubscribe ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull RoadInfos roadInfos) {
|
||||
Log.d(TAG, "queryRoadInfos onNext roadInfos = " + roadInfos.getData());
|
||||
public void onNext(@NonNull BaseData<RoadInfos> roadInfos) {
|
||||
Log.d(TAG, "queryRoadInfos onNext roadInfos = " + roadInfos.getResult().getData());
|
||||
callback.onSuccess(roadInfos);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.mogo.cloud.commons.network.BaseData;
|
||||
import com.mogo.cloud.commons.network.RetrofitFactory;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.tanlu.api.IRoadInfoSearchCallback;
|
||||
@@ -84,15 +85,15 @@ public class UploadManager {
|
||||
apiService.uploadInformation(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<UploadResult>() {
|
||||
.subscribe(new Observer<BaseData<UploadResult>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.d(TAG, "onSubscribe -----> ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(UploadResult result) {
|
||||
Log.d(TAG, "onNext id = -----> " + result.id);
|
||||
public void onNext(BaseData<UploadResult> result) {
|
||||
Log.d(TAG, "onNext id = -----> " + result.getResult().id);
|
||||
callback.onSuccess(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.cloud.tanlu.api;
|
||||
|
||||
import com.mogo.cloud.commons.network.BaseData;
|
||||
import com.mogo.cloud.tanlu.bean.RoadInfos;
|
||||
|
||||
/**
|
||||
@@ -8,7 +9,7 @@ import com.mogo.cloud.tanlu.bean.RoadInfos;
|
||||
* @since 2021/1/20
|
||||
*/
|
||||
public interface IRoadInfoSearchCallback {
|
||||
void onSuccess(RoadInfos result);
|
||||
void onSuccess(BaseData<RoadInfos> result);
|
||||
void onFailure(int code);
|
||||
void onError(Throwable e);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.cloud.tanlu.api;
|
||||
|
||||
import com.mogo.cloud.commons.network.BaseData;
|
||||
import com.mogo.cloud.tanlu.bean.UploadResult;
|
||||
|
||||
/**
|
||||
@@ -8,7 +9,7 @@ import com.mogo.cloud.tanlu.bean.UploadResult;
|
||||
* @since 2021/1/20
|
||||
*/
|
||||
public interface ITanluUploadCallback {
|
||||
void onSuccess(UploadResult result);
|
||||
void onSuccess(BaseData<UploadResult> result);
|
||||
void onFailure(int code);
|
||||
void onError(Throwable e);
|
||||
}
|
||||
|
||||
@@ -7,4 +7,7 @@ package com.mogo.cloud.tanlu.constant;
|
||||
*/
|
||||
public class HttpConstant {
|
||||
|
||||
public static final String DZT_HOTS = "http://dzt-deva.zhidaozhixing.com";
|
||||
public static final String LAUNCHER_HOTS = "http://dzt-launcherSnapshot.zhidaozhixing.com";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.cloud.tanlu.net;
|
||||
|
||||
import com.mogo.cloud.commons.network.BaseData;
|
||||
import com.mogo.cloud.tanlu.bean.RoadInfos;
|
||||
import com.mogo.cloud.tanlu.bean.UploadResult;
|
||||
|
||||
@@ -20,16 +21,16 @@ public interface TanluApiService {
|
||||
* 查询(搜索)道路事件信息
|
||||
* 接口文档:http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=42305842
|
||||
* 文档中有些参数暂时没有用到,包括radius,limit
|
||||
* @return
|
||||
* @return dzt-launcherSnapshot.zhidaozhixing.com
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-launcherSnapshot/launcherSnapshot/searchRoadEventsSync")
|
||||
// Observable<BaseDataCompat<RoadInfos>> queryRoadInfos(@FieldMap Map<String, Object> params);
|
||||
Observable<RoadInfos> queryRoadInfos(@FieldMap Map<String, Object> params);
|
||||
Observable<BaseData<RoadInfos>> queryRoadInfos(@FieldMap Map<String, Object> params);
|
||||
|
||||
//上报情报数据
|
||||
//上报情报数据 dzt-deva.zhidaozhixing.com
|
||||
@FormUrlEncoded
|
||||
@POST("/deva/car/path/no/addInfomation/v2")
|
||||
Observable<UploadResult> uploadInformation(@FieldMap Map<String, String> information);
|
||||
Observable<BaseData<UploadResult>> uploadInformation(@FieldMap Map<String, String> information);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.cloud.tanlu.utils;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
@@ -7,4 +9,11 @@ package com.mogo.cloud.tanlu.utils;
|
||||
*/
|
||||
public class TanluUtils {
|
||||
|
||||
public static boolean isVideo(String path) {
|
||||
String reg = "(mp4|flv|avi|rm|rmvb|wmv)";
|
||||
Pattern p = Pattern.compile(reg);
|
||||
|
||||
return p.matcher(path).find();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user