Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -3,9 +3,13 @@ package com.mogo.cloud;
|
||||
import android.app.Application;
|
||||
|
||||
import com.mogo.cloud.httpdns.MogoHttpDnsConfig;
|
||||
import com.mogo.cloud.httpdns.bean.HttpDnsSimpleLocation;
|
||||
import com.mogo.cloud.httpdns.listener.IHttpDnsCurrentLocation;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
@@ -26,11 +30,16 @@ public class MoGoApplication extends Application {
|
||||
clientConfig.setShowDebugLog(true);
|
||||
clientConfig.setThirdPartyAppKey("bydauto");
|
||||
clientConfig.setThirdPartyDeviceId("bydauto");
|
||||
clientConfig.setLat(randomLat);
|
||||
clientConfig.setLon(randomLon);
|
||||
clientConfig.setCityCode("010");
|
||||
clientConfig.setLoopCheckDelay(15 * 1000);
|
||||
|
||||
clientConfig.setIHttpDnsCurrentLocation(new IHttpDnsCurrentLocation() {
|
||||
@Nullable
|
||||
@Override
|
||||
public HttpDnsSimpleLocation getCurrentLocation() {
|
||||
return new HttpDnsSimpleLocation("010", randomLat, randomLon);
|
||||
}
|
||||
});
|
||||
|
||||
MoGoAiCloudClient.getInstance().init(this, clientConfig);
|
||||
|
||||
}
|
||||
|
||||
@@ -95,10 +95,7 @@ public class MoGoAiCloudClient {
|
||||
.setSn(mAiCloudClientConfig.sn)
|
||||
.setEnv(mAiCloudClientConfig.getNetMode())
|
||||
.setShowDebugLog(mAiCloudClientConfig.isShowDebugLog())
|
||||
.setCurrentLocation(() -> new HttpDnsSimpleLocation(
|
||||
mAiCloudClientConfig.getCityCode(),
|
||||
mAiCloudClientConfig.getLat(),
|
||||
mAiCloudClientConfig.getLon()))
|
||||
.setCurrentLocation(mAiCloudClientConfig.getIHttpDnsCurrentLocation())
|
||||
.setLoopCheckDelay(mAiCloudClientConfig.getLoopCheckDelay());
|
||||
MogoHttpDnsClient.INSTANCE.init(mHttpDnsConfig);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.cloud.passport;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.cloud.httpdns.MogoHttpDnsConfig;
|
||||
import com.mogo.cloud.httpdns.listener.IHttpDnsCurrentLocation;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
@@ -50,23 +51,16 @@ public class MoGoAiCloudClientConfig {
|
||||
*/
|
||||
String sn = "";
|
||||
|
||||
/**
|
||||
* 城市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
/**
|
||||
* 当前的纬度
|
||||
*/
|
||||
private double lat;
|
||||
/**
|
||||
* 当前的经度
|
||||
*/
|
||||
private double lon;
|
||||
/**
|
||||
* 循环检测延时时间
|
||||
*/
|
||||
private long mLoopCheckDelay;
|
||||
|
||||
/**
|
||||
* 设置HttpDns的位置监听
|
||||
*/
|
||||
private IHttpDnsCurrentLocation mIHttpDnsCurrentLocation;
|
||||
|
||||
public String getThirdPartyDeviceId() {
|
||||
return thirdPartyDeviceId;
|
||||
}
|
||||
@@ -121,30 +115,6 @@ public class MoGoAiCloudClientConfig {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public String getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
public void setCityCode(String cityCode) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public boolean isShowDebugLog() {
|
||||
return isShowDebugLog;
|
||||
}
|
||||
@@ -161,6 +131,14 @@ public class MoGoAiCloudClientConfig {
|
||||
mLoopCheckDelay = loopCheckDelay;
|
||||
}
|
||||
|
||||
public IHttpDnsCurrentLocation getIHttpDnsCurrentLocation() {
|
||||
return mIHttpDnsCurrentLocation;
|
||||
}
|
||||
|
||||
public void setIHttpDnsCurrentLocation(IHttpDnsCurrentLocation IHttpDnsCurrentLocation) {
|
||||
mIHttpDnsCurrentLocation = IHttpDnsCurrentLocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MoGoAiCloudClientConfig{" +
|
||||
@@ -172,10 +150,8 @@ public class MoGoAiCloudClientConfig {
|
||||
", isShowDebugLog=" + isShowDebugLog +
|
||||
", token='" + token + '\'' +
|
||||
", sn='" + sn + '\'' +
|
||||
", cityCode='" + cityCode + '\'' +
|
||||
", lat=" + lat +
|
||||
", lon=" + lon +
|
||||
", mLoopCheckDelay=" + mLoopCheckDelay +
|
||||
", mIHttpDnsCurrentLocation=" + mIHttpDnsCurrentLocation +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user