统一域名
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
package com.mogo.eagle.core.function
|
||||||
|
|
||||||
|
import com.mogo.commons.debug.DebugConfig
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cmdb 域名
|
||||||
|
*/
|
||||||
|
class BindHostConst {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val UPGRADE_APP_HOST_DEV = "https://eagle-qa.zhidaozhixing.com/"
|
||||||
|
private const val UPGRADE_APP_HOST = "http://eagle-mis.zhidaozhixing.com/"
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun getBaseUrl(): String {
|
||||||
|
return when (DebugConfig.getNetMode()) {
|
||||||
|
DebugConfig.NET_MODE_DEV -> UPGRADE_APP_HOST_DEV
|
||||||
|
DebugConfig.NET_MODE_QA -> UPGRADE_APP_HOST_DEV
|
||||||
|
DebugConfig.NET_MODE_DEMO -> UPGRADE_APP_HOST
|
||||||
|
DebugConfig.NET_MODE_RELEASE -> UPGRADE_APP_HOST
|
||||||
|
else -> UPGRADE_APP_HOST
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ public interface UpgradeApiService {
|
|||||||
* @return {@link UpgradeAppInfo}
|
* @return {@link UpgradeAppInfo}
|
||||||
*/
|
*/
|
||||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||||
@POST("/eagleEye-mis/config/versionInfo")
|
@POST("eagleEye-mis/config/versionInfo")
|
||||||
// Observable<UpgradeAppInfo> getUpgradeInfo(@Query("resources") String res, @Body RequestBody requestBody);
|
// Observable<UpgradeAppInfo> getUpgradeInfo(@Query("resources") String res, @Body RequestBody requestBody);
|
||||||
Observable<UpgradeAppInfo> getUpgradeInfo(@Body RequestBody requestBody);
|
Observable<UpgradeAppInfo> getUpgradeInfo(@Body RequestBody requestBody);
|
||||||
|
|
||||||
|
|||||||
@@ -4,20 +4,13 @@ import android.content.Context;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
|
||||||
import com.mogo.eagle.core.data.bindingcar.BindingcarInfo;
|
|
||||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo;
|
|
||||||
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
|
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
|
||||||
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
|
import com.mogo.eagle.core.function.BindHostConst;
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
|
||||||
import com.mogo.eagle.core.utilcode.util.AppUtils;
|
import com.mogo.eagle.core.utilcode.util.AppUtils;
|
||||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
|
||||||
import com.mogo.module.common.constants.HostConst;
|
|
||||||
|
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
@@ -39,7 +32,7 @@ public class UpgradeAppNetWorkManager {
|
|||||||
|
|
||||||
|
|
||||||
private UpgradeAppNetWorkManager() {
|
private UpgradeAppNetWorkManager() {
|
||||||
mUpgradeApiService = MoGoRetrofitFactory.getInstance(HostConst.UPGRADE_APP_HOST)
|
mUpgradeApiService = MoGoRetrofitFactory.getInstance(BindHostConst.getBaseUrl())
|
||||||
.create(UpgradeApiService.class);
|
.create(UpgradeApiService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +57,7 @@ public class UpgradeAppNetWorkManager {
|
|||||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||||
int versionCode = AppUtils.getAppVersionCode();
|
int versionCode = AppUtils.getAppVersionCode();
|
||||||
CallerLogger.INSTANCE.d(TAG, "getAppUpgradeInfo mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode);
|
CallerLogger.INSTANCE.d(TAG, "getAppUpgradeInfo mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode);
|
||||||
Log.d("Upgrade", "mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode);
|
Log.d(TAG, "mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode);
|
||||||
UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, screenType);
|
UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, screenType);
|
||||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
||||||
mUpgradeApiService.getUpgradeInfo(requestBody)
|
mUpgradeApiService.getUpgradeInfo(requestBody)
|
||||||
|
|||||||
@@ -22,7 +22,4 @@ public class HostConst {
|
|||||||
public static final String BINDING_SN_HOST = "https://mygateway.zhidaozhixing.com/cmdbapi/"; //中台提供的接口服务
|
public static final String BINDING_SN_HOST = "https://mygateway.zhidaozhixing.com/cmdbapi/"; //中台提供的接口服务
|
||||||
public static final String BINDING_SN_HOST_TEST = "https://mygateway.zhidaozhixing.com/cmdbapitest/"; //中台提供的接口服务测试
|
public static final String BINDING_SN_HOST_TEST = "https://mygateway.zhidaozhixing.com/cmdbapitest/"; //中台提供的接口服务测试
|
||||||
|
|
||||||
// public static final String UPGRADE_APP_HOST = "http://10.0.200.12:32423?/";
|
|
||||||
public static final String UPGRADE_APP_HOST = "https://eagle-qa.zhidaozhixing.com/";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user