[251]OCH: update get BASE_URL method(基于env flavor)
This commit is contained in:
@@ -32,14 +32,10 @@ android {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
buildConfigField('String', 'BASE_URL', '"https://tech.zhidaohulian.com"')
|
||||
}
|
||||
debug {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
// buildConfigField('String', 'BASE_URL', '"http://tech-dev.zhidaohulian.com"')
|
||||
buildConfigField('String', 'BASE_URL', '"https://tech-qa.zhidaohulian.com"')
|
||||
// buildConfigField('String', 'BASE_URL', '"http://yapi.svc-dev.zhidaoauto.com/"')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,27 @@
|
||||
package com.mogo.och.bus.constant
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
|
||||
/**
|
||||
* Created on 2021/12/6
|
||||
*/
|
||||
class OchBusConst {
|
||||
companion object {
|
||||
|
||||
private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com"
|
||||
private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com"
|
||||
private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com"
|
||||
|
||||
@JvmStatic
|
||||
fun getBaseUrl(): String {
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV
|
||||
DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA
|
||||
DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE
|
||||
else -> BASE_URL_OCH_RELEASE
|
||||
}
|
||||
}
|
||||
|
||||
// OCH arouter 路由path
|
||||
const val PATH = "/och/api"
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.mogo.eagle.core.network.RequestOptions;
|
||||
import com.mogo.eagle.core.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.bus.BuildConfig;
|
||||
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
|
||||
import com.mogo.och.bus.bean.OchBusOperationStatusRequest;
|
||||
import com.mogo.och.bus.bean.OchBusOperationStatusResponse;
|
||||
@@ -19,6 +18,7 @@ import com.mogo.och.bus.bean.OchBusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.OchBusUpdateSiteStatusRequest;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersRequest;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersResponse;
|
||||
import com.mogo.och.bus.constant.OchBusConst;
|
||||
import com.mogo.och.bus.presenter.OchBusOrderModel;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@@ -32,7 +32,7 @@ public class OCHBusServiceManager {
|
||||
private static final String TAG = OCHBusServiceManager.class.getSimpleName();
|
||||
private IOchBusApiService mService;
|
||||
|
||||
private String baseUrl = BuildConfig.BASE_URL;
|
||||
private String baseUrl = OchBusConst.getBaseUrl();
|
||||
private static final class SingletonHolder {
|
||||
private static final OCHBusServiceManager INSTANCE = new OCHBusServiceManager();
|
||||
}
|
||||
|
||||
@@ -33,13 +33,10 @@ android {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
buildConfigField('String', 'BASE_URL', '"https://tech.zhidaohulian.com"')
|
||||
}
|
||||
debug {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
// buildConfigField('String', 'BASE_URL', '"http://tech-dev.zhidaohulian.com"')
|
||||
buildConfigField('String', 'BASE_URL', '"https://tech-qa.zhidaohulian.com"')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,27 @@
|
||||
package com.mogo.och.taxi.constant
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
|
||||
/**
|
||||
* Created on 2021/12/6
|
||||
*/
|
||||
class OCHTaxiConst {
|
||||
companion object {
|
||||
|
||||
private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com"
|
||||
private const val BASE_URL_OCH_QA = "https://tech-qa.zhidaohulian.com"
|
||||
private const val BASE_URL_OCH_RELEASE = "https://tech.zhidaohulian.com"
|
||||
|
||||
@JvmStatic
|
||||
fun getBaseUrl(): String {
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> BASE_URL_OCH_DEV
|
||||
DebugConfig.NET_MODE_QA -> BASE_URL_OCH_QA
|
||||
DebugConfig.NET_MODE_RELEASE -> BASE_URL_OCH_RELEASE
|
||||
else -> BASE_URL_OCH_RELEASE
|
||||
}
|
||||
}
|
||||
|
||||
// OCH arouter 路由path
|
||||
const val PATH = "/och/api"
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.mogo.eagle.core.network.RequestOptions;
|
||||
import com.mogo.eagle.core.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.taxi.BuildConfig;
|
||||
import com.mogo.och.taxi.bean.CarHeartbeatReqBean;
|
||||
import com.mogo.och.taxi.bean.DriverServiceDataRespBean;
|
||||
import com.mogo.och.taxi.bean.DriverStatusQueryRespBean;
|
||||
@@ -26,6 +25,7 @@ import com.mogo.och.taxi.bean.OrdersInServiceQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrdersListQueryReqBean;
|
||||
import com.mogo.och.taxi.bean.OrdersListQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrdersNewBookingQueryRespBean;
|
||||
import com.mogo.och.taxi.constant.OCHTaxiConst;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
@@ -44,7 +44,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private String baseUrl = BuildConfig.BASE_URL;
|
||||
private String baseUrl = OCHTaxiConst.getBaseUrl();
|
||||
private OCHTaxiServiceApiNew mOCHTaxiServiceApi;
|
||||
|
||||
private OCHTaxiServiceManagerNew() {
|
||||
|
||||
@@ -138,7 +138,7 @@ android {
|
||||
]
|
||||
}
|
||||
release {
|
||||
debuggable true
|
||||
debuggable false
|
||||
minifyEnabled false
|
||||
zipAlignEnabled false
|
||||
shrinkResources false
|
||||
|
||||
Reference in New Issue
Block a user