添加部分域名
This commit is contained in:
@@ -87,13 +87,14 @@ public class MogoHttpDns implements IMogoHttpDns, HttpDns, OnAddressChangedListe
|
||||
|
||||
@Override
|
||||
public void init(Context context, final IHttpDnsLocationChanged locationChanged) {
|
||||
httpDnsHelper = new HttpDnsHelper.Builder().setContext(context).setEnv(DebugConfig.getNetMode()).setDefaultUrl("dzt.zhidaozhixing.com").setSn(Utils.getSn()).setShowDebugLog(true).setLoopCheckDelay(15 * 60 * 1000).setCurrentLocation(new IHttpDnsCurrentLocation() {
|
||||
// .setDefaultUrl("dzt.zhidaozhixing.com")
|
||||
httpDnsHelper = new HttpDnsHelper.Builder().setContext(context).setEnv(DebugConfig.getNetMode()).setSn(Utils.getSn()).setShowDebugLog(true).setLoopCheckDelay(15 * 60 * 1000).setCurrentLocation(new IHttpDnsCurrentLocation() {
|
||||
@org.jetbrains.annotations.Nullable
|
||||
@Override
|
||||
public HttpDnsSimpleLocation getCurrentLocation() {
|
||||
HttpSimpleLocation simpleLocation = locationChanged.getLocation();
|
||||
if (simpleLocation != null) {
|
||||
return new HttpDnsSimpleLocation(simpleLocation.getCityCode(), simpleLocation.getLat(), simpleLocation.getLon());
|
||||
return new HttpDnsSimpleLocation("0734", simpleLocation.getLat(), simpleLocation.getLon());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.authorize.model
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.module.authorize.constant.HttpConstant
|
||||
import com.mogo.module.authorize.net.AuthorizeApi
|
||||
import com.mogo.module.common.constants.HostConst
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.MogoServicePaths
|
||||
|
||||
@@ -18,6 +19,6 @@ open class BaseRepository {
|
||||
if (mogoService is IMogoServiceApis) {
|
||||
serviceApi = mogoService
|
||||
}
|
||||
return serviceApi!!.networkApi.createNoCallAdapter(AuthorizeApi::class.java, HttpConstant.getNetHost())
|
||||
return serviceApi!!.networkApi.createNoCallAdapter(AuthorizeApi::class.java, HostConst.CHANNEL_MANAGER_HOST)
|
||||
}
|
||||
}
|
||||
@@ -1046,7 +1046,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
public void onMsgReceived(String obj) {
|
||||
if (mStatusManager.isSeekHelping()) {
|
||||
int seekNum = SharedPrefsMgr.getInstance(getContext()).getInt("seek_help_num", 0);
|
||||
final int finalSeekNum = seekNum++;
|
||||
final int finalSeekNum = ++seekNum;
|
||||
SharedPrefsMgr.getInstance(getContext()).putInt("seek_help_num", seekNum);
|
||||
handler.post(() -> {
|
||||
seekHelpGroup.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.mogo.module.extensions.bean.CommonConfigResponse;
|
||||
import com.mogo.module.extensions.net.GetConfigApiServices;
|
||||
import com.mogo.module.extensions.net.UserInfoNetApiServices;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.module.extensions.userinfo.UserInfoConstant;
|
||||
import com.mogo.module.extensions.userinfo.UserInfoResponse;
|
||||
import com.mogo.module.extensions.weather.Phenomena;
|
||||
import com.mogo.module.extensions.weather.WeatherCallback;
|
||||
@@ -189,7 +188,7 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
|
||||
params.put("source", "2");
|
||||
String sign = createSign(params, "JGqZw9");
|
||||
params.put("sig", sign);
|
||||
mNetWork.create(UserInfoNetApiServices.class, UserInfoConstant.getUserInfoBaseUrl()).requestUserInfo(params).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new SingleObserver<UserInfoResponse>() {
|
||||
mNetWork.create(UserInfoNetApiServices.class, HostConst.CARLIFE_HOST).requestUserInfo(params).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new SingleObserver<UserInfoResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.mogo.module.extensions.userinfo;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
|
||||
/**
|
||||
* 个人信息相关常量
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class UserInfoConstant {
|
||||
private static final String DEV_BASE_URL = "http://carlife-dev.zhidaohulian.com/";
|
||||
private static final String QA_BASE_URL = "http://carlife-test.zhidaohulian.com/";
|
||||
private static final String NORMAL_BASE_URL = "http://api.zhidaohulian.com/";
|
||||
|
||||
public static String getUserInfoBaseUrl(){
|
||||
switch (DebugConfig.getNetMode()) {
|
||||
case DebugConfig.NET_MODE_DEV:
|
||||
return DEV_BASE_URL;
|
||||
case DebugConfig.NET_MODE_RELEASE:
|
||||
return NORMAL_BASE_URL;
|
||||
default:
|
||||
return QA_BASE_URL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,11 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.network.ParamsProvider;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.storage.SpStorage;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.module.service.MogoServices;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.network.RefreshApiService;
|
||||
import com.mogo.module.service.network.bean.HomeCompanyDistanceForPushData;
|
||||
import com.mogo.module.service.network.bean.HomeCompanyDistanceForPushResponse;
|
||||
import com.mogo.module.service.onlinecar.panel.NavigationTargetInfo;
|
||||
@@ -86,7 +89,7 @@ abstract class MainLooperHandler extends Handler {
|
||||
|
||||
final Map< String, Object > query = new ParamsProvider.Builder( AbsMogoApplication.getApp() ).build();
|
||||
query.put( "data", GsonUtil.jsonFromObject( data ) );
|
||||
MogoServices.getInstance().getRefreshModel().getRefreshApiService().calculationNotHomeCompanyDistanceForPush( query )
|
||||
MogoApisHandler.getInstance().getApis().getNetworkApi().create(RefreshApiService.class, HostConst.TRAVEL_CONDITION_HOST).calculationNotHomeCompanyDistanceForPush( query )
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( new SubscribeImpl< HomeCompanyDistanceForPushResponse >( RequestOptions.create( AbsMogoApplication.getApp() ) ) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.commons.network.ParamsProvider;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
@@ -33,34 +34,14 @@ public class ZhidaoRefreshModel {
|
||||
|
||||
private static final String TAG = "RefreshModel";
|
||||
|
||||
public static final String HOST_DEV = "http://carlife-test.zhidaohulian.com";
|
||||
public static final String HOST_TEST = "http://carlife-test.zhidaohulian.com";
|
||||
public static final String HOST_DEMO = "http://carlife-test.zhidaohulian.com";
|
||||
public static final String HOST_PRODUCT = "https://api.zhidaohulian.com";
|
||||
|
||||
private final Context mContext;
|
||||
private final ZhidaoApiService mRefreshApiService;
|
||||
|
||||
public ZhidaoRefreshModel( Context context ) {
|
||||
this.mContext = context;
|
||||
IMogoNetwork network = ( IMogoNetwork ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_NETWORK ).navigation( context );
|
||||
this.mRefreshApiService = network.create( ZhidaoApiService.class, getNetHost() );
|
||||
this.mRefreshApiService = network.create( ZhidaoApiService.class, HostConst.CARLIFE_HOST);
|
||||
}
|
||||
|
||||
public ZhidaoApiService getRefreshApiService() {
|
||||
return mRefreshApiService;
|
||||
}
|
||||
|
||||
public static String getNetHost() {
|
||||
switch ( DebugConfig.getNetMode() ) {
|
||||
case DebugConfig.NET_MODE_DEV:
|
||||
return HOST_DEV;
|
||||
case DebugConfig.NET_MODE_QA:
|
||||
return HOST_TEST;
|
||||
case DebugConfig.NET_MODE_DEMO:
|
||||
return HOST_DEMO;
|
||||
default:
|
||||
return HOST_PRODUCT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user