[1.0.2]
[url 全部由urlConfg.json 来进行配置]
This commit is contained in:
yangyakun
2023-02-14 19:29:38 +08:00
parent 75625a41d8
commit 87a2c2201a
22 changed files with 87 additions and 164 deletions

View File

@@ -3,38 +3,20 @@ package com.mogo.och.bus.passenger.constant
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.och.common.module.biz.constant.OchCommonConst
/**
* Created on 2021/12/6
*/
class URLConst {
companion object {
// shettle 接驳车域名
private const val Shettle_BASE_URL_OCH_DEV = "https://och-driver-dev.zhidaozhixing.com"
private const val Shettle_BASE_URL_OCH_QA = "https://och-driver-qa.zhidaozhixing.com"
private const val Shettle_BASE_URL_OCH_RELEASE = "https://och-driver.zhidaozhixing.com"
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 if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)){
when (DebugConfig.getNetMode()) {
DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> Shettle_BASE_URL_OCH_DEV
DebugConfig.NET_MODE_QA -> Shettle_BASE_URL_OCH_QA
DebugConfig.NET_MODE_RELEASE -> Shettle_BASE_URL_OCH_RELEASE
else -> Shettle_BASE_URL_OCH_RELEASE
}
OchCommonConst.getShuttleUrl()
}else{
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
}
OchCommonConst.getBaseUrl()
}
}

View File

@@ -5,10 +5,9 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.getSer
import com.mogo.och.bus.passenger.bean.response.BusPassengerRoutesResponse
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.och.bus.passenger.bean.request.BusPassengerQueryLineRequest
import com.mogo.och.bus.passenger.bean.response.BusPassengerOperationStatusResponse
import com.mogo.och.common.module.biz.constant.OchCommonConst.Companion.getBaseUrl
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
@@ -19,7 +18,7 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry
object BusPassengerServiceManager {
private var mBusPassengerServiceApi =
MoGoRetrofitFactory.getInstance(getBaseUrl()).create(PassengerServiceApi::class.java)
MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(PassengerServiceApi::class.java)
/**
* 获取Bus司机端的sn

View File

@@ -9,20 +9,6 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
*/
class URLConst {
companion object {
// shettle 接驳车域名
private const val Shettle_BASE_URL_OCH_DEV = "https://och-driver-dev.zhidaozhixing.com"
private const val Shettle_BASE_URL_OCH_QA = "https://och-driver-qa.zhidaozhixing.com"
private const val Shettle_BASE_URL_OCH_RELEASE = "https://och-driver.zhidaozhixing.com"
@JvmStatic
fun getBaseUrl(): String {
return when (DebugConfig.getNetMode()) {
DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_DEMO -> Shettle_BASE_URL_OCH_DEV
DebugConfig.NET_MODE_QA -> Shettle_BASE_URL_OCH_QA
DebugConfig.NET_MODE_RELEASE -> Shettle_BASE_URL_OCH_RELEASE
else -> Shettle_BASE_URL_OCH_RELEASE
}
}
}
}

View File

@@ -7,8 +7,8 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.bus.passenger.bean.PM2OperationStatusResponse
import com.mogo.och.bus.passenger.bean.PM2QueryLineRequest
import com.mogo.och.bus.passenger.bean.PM2RoutesResponse
import com.mogo.och.bus.passenger.constant.URLConst.Companion.getBaseUrl
import com.mogo.och.bus.passenger.network.PM2ServiceApi
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
@@ -19,7 +19,7 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry
object PM2ServiceManager {
private var mBusPassengerServiceApi =
MoGoRetrofitFactory.getInstance(getBaseUrl()).create(PM2ServiceApi::class.java)
MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create(PM2ServiceApi::class.java)
/**
* 获取Bus司机端的sn

View File

@@ -7,19 +7,6 @@ import com.mogo.commons.debug.DebugConfig
*/
class URLConst {
companion object {
private const val BASE_URL_OCH_DEV = "https://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
}
}
}
}

View File

@@ -5,7 +5,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.bus.bean.*
import com.mogo.och.bus.constant.URLConst.Companion.getBaseUrl
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
@@ -16,7 +16,7 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry
*/
object OrderServiceManager {
private val M_SERVICE: IBascApiService = MoGoRetrofitFactory.getInstance(getBaseUrl()).create(
private val M_SERVICE: IBascApiService = MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(
IBascApiService::class.java
)

View File

@@ -11,7 +11,6 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.bus.constant.URLConst.Companion.getBaseUrl
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
@@ -24,7 +23,7 @@ object OchCommonServiceManager {
private const val TAG = "OchCommonServiceManager"
private val mLoginServiceApi: OchLoginServiceApi =
MoGoRetrofitFactory.getInstance(getBaseUrl()).create(
MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(
OchLoginServiceApi::class.java
)

View File

@@ -8,18 +8,5 @@ import com.mogo.commons.debug.DebugConfig
class URLConst {
companion object {
private const val BASE_URL_OCH_DEV = "https://och-driver-dev.zhidaozhixing.com"
private const val BASE_URL_OCH_QA = "https://och-driver-qa.zhidaozhixing.com"
private const val BASE_URL_OCH_RELEASE = "https://och-driver.zhidaozhixing.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
}
}
}
}

View File

@@ -5,7 +5,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.bus.bean.*
import com.mogo.och.bus.constant.URLConst.Companion.getBaseUrl
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
@@ -16,7 +16,7 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry
*/
object OrderServiceManager {
private val mService: IBascApiService = MoGoRetrofitFactory.getInstance(getBaseUrl()).create(
private val mService: IBascApiService = MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create(
IBascApiService::class.java
)

View File

@@ -11,7 +11,6 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.bus.constant.URLConst.Companion.getBaseUrl
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
@@ -24,7 +23,7 @@ object OchCommonServiceManager {
private const val TAG = "OchCommonServiceManager"
private val mLoginServiceApi: OchLoginServiceApi =
MoGoRetrofitFactory.getInstance(getBaseUrl()).create(
MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create(
OchLoginServiceApi::class.java
)

View File

@@ -1,25 +1,19 @@
package com.mogo.och.common.module.biz.constant
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.config.FunctionBuildConfig
/**
* Created on 2021/12/6
*/
class OchCommonConst {
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
}
return FunctionBuildConfig.urlJson.ochUrl
}
@JvmStatic
fun getShuttleUrl(): String {
return FunctionBuildConfig.urlJson.ochUrl
}
// token 失效 重新获取token
const val WAIT_TAKEN = 100046

View File

@@ -8,20 +8,6 @@ import com.mogo.commons.debug.DebugConfig
class SweeperConst {
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 = "/driver/api"

View File

@@ -9,6 +9,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory;
import com.mogo.eagle.core.network.RequestOptions;
import com.mogo.eagle.core.network.SubscribeImpl;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.och.common.module.biz.constant.OchCommonConst;
import com.mogo.och.sweeper.bean.SweeperQueryLinesResponse;
import com.mogo.och.sweeper.bean.SweeperRoutePlanningUpdateReqBean;
import com.mogo.och.sweeper.bean.SweeperRoutesResponse;
@@ -18,7 +19,6 @@ import com.mogo.och.sweeper.bean.SweeperOperationStatusResponse;
import com.mogo.och.sweeper.bean.SweeperQueryLineStationsRequest;
import com.mogo.och.sweeper.bean.SweeperResetDrivingLineRequest;
import com.mogo.och.sweeper.bean.SweeperUpdateSiteStatusRequest;
import com.mogo.och.sweeper.constant.SweeperConst;
import com.mogo.och.sweeper.model.SweeperOrderModel;
import java.util.List;
@@ -45,7 +45,7 @@ public class SweeperServiceManager {
}
private SweeperServiceManager(){
mService = MoGoRetrofitFactory.getInstance(SweeperConst.getBaseUrl()).create(ISweeperApiService.class);
mService = MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(ISweeperApiService.class);
}
/**

View File

@@ -8,20 +8,6 @@ import com.mogo.commons.debug.DebugConfig
class TaxiPassengerConst {
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 = "/passenger/api"

View File

@@ -1,7 +1,6 @@
package com.mogo.och.taxi.passenger.network
import android.content.Context
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst.Companion.getBaseUrl
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.getServerToken
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrdersInServiceQueryRespBean
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
@@ -15,6 +14,7 @@ import com.mogo.och.taxi.passenger.bean.TaxiPassengerScoreUpdateOrderReqBean
import com.mogo.och.taxi.passenger.bean.TaxiPassengerAllStarWorld
import com.mogo.och.taxi.passenger.bean.TaxiPassengerStartReqBean
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
@@ -24,7 +24,7 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry
*/
object TaxiPassengerServiceManager {
private val mOCHTaxiServiceApi: TaxiPassengerServiceApi = MoGoRetrofitFactory.getInstance(getBaseUrl()).create(
private val mOCHTaxiServiceApi: TaxiPassengerServiceApi = MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(
TaxiPassengerServiceApi::class.java
)

View File

@@ -8,20 +8,6 @@ import com.mogo.commons.debug.DebugConfig
class TaxiConst {
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 = "/driver/api"

View File

@@ -1,10 +1,10 @@
package com.mogo.och.taxi.network
import android.content.Context
import com.mogo.och.taxi.constant.TaxiConst.Companion.getBaseUrl
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
@@ -18,7 +18,7 @@ object TaxiServiceManager {
private var mOCHTaxiServiceApi: TaxiServiceApiNew =
MoGoRetrofitFactory.getInstance(getBaseUrl()).create(
MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(
TaxiServiceApiNew::class.java
)

View File

@@ -1,24 +0,0 @@
{
"mogo": {
"qa": {
"och_url": "https://tech-qa.zhidaohulian.com"
},
"online": {
"och_url": "https://tech-qa.zhidaohulian.com"
},
"demo": {
"och_url": "https://tech-qa.zhidaohulian.com"
}
},
"dali": {
"qa": {
"och_url": "https://tech-qa.zhidaohulian.com"
},
"online": {
"och_url": "https://tech-qa.zhidaohulian.com"
},
"demo": {
"och_url": "https://tech-qa.zhidaohulian.com"
}
}
}

View File

@@ -28,7 +28,7 @@ project.android.applicationVariants.all { variant ->
Object readFileToJson(project, env) {
try {
// 加载config.json 文件
File file = new File("${rootDir}/app/config.json")
File file = new File("${rootDir}/app/urlConfig.json")
def jsonSlurper = new JsonSlurper()
// 解析json
def config = jsonSlurper.parse(file)

48
app/urlConfig.json Normal file
View File

@@ -0,0 +1,48 @@
{
"mogo": {
"qa": {
"och_url": "https://tech-qa.zhidaohulian.com",
"shuttle_url": "https://och-driver-qa.zhidaozhixing.com",
"passport_url": "",
"socket_base_url": "",
"socket_tech_url": ""
},
"online": {
"och_url": "http://tech-dev.zhidaohulian.com",
"shuttle_url": "https://och-driver.zhidaozhixing.com",
"passport_url": "",
"socket_base_url": "",
"socket_tech_url": ""
},
"demo": {
"och_url": "http://tech-dev.zhidaohulian.com",
"shuttle_url": "https://och-driver-dev.zhidaozhixing.com",
"passport_url": "",
"socket_base_url": "",
"socket_tech_url": ""
}
},
"dali": {
"qa": {
"och_url": "https://tech-qa.zhidaohulian.com",
"shuttle_url": "https://och-driver-qa.zhidaozhixing.com",
"passport_url": "https://och-a.zhidaozhixing.com/arch/passport/",
"socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/",
"socket_tech_url": "https://och-a.zhidaozhixing.com/arch/"
},
"online": {
"och_url": "https://tech-qa.zhidaohulian.com",
"shuttle_url": "https://och-driver.zhidaozhixing.com",
"passport_url": "https://och-a.zhidaozhixing.com/arch/passport/",
"socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/",
"socket_tech_url": "https://och-a.zhidaozhixing.com/arch/"
},
"demo": {
"och_url": "https://tech-qa.zhidaohulian.com",
"shuttle_url": "https://och-driver-dev.zhidaozhixing.com",
"passport_url": "https://och-a.zhidaozhixing.com/arch/passport/",
"socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/",
"socket_tech_url": "https://och-a.zhidaozhixing.com/arch/"
}
}
}

View File

@@ -94,9 +94,9 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientConfig.isUseOriginSocket = true
// 设置是否输出网络日志
clientConfig.isShowNetDebugLog = false
// clientConfig.passportUrl //todo yakun
// clientConfig.socketBaseUrl
// clientConfig.socketTechUrl
clientConfig.passportUrl = FunctionBuildConfig.urlJson.passportUrl
clientConfig.socketBaseUrl = FunctionBuildConfig.urlJson.socketBaseUrl
clientConfig.socketTechUrl = FunctionBuildConfig.urlJson.socketTechUrl
// 设置是否是直播推流的主播
clientConfig.isAnchor = true
when (DebugConfig.getCarMachineType()) {

View File

@@ -4,5 +4,13 @@ import com.google.gson.annotations.SerializedName
data class UrlConfig(
@SerializedName("och_url")
val ochUrl: String
val ochUrl: String,
@SerializedName("shuttle_url")
val shuttleUrl: String,
@SerializedName("passport_url")
val passportUrl: String,
@SerializedName("socket_base_url")
val socketBaseUrl: String,
@SerializedName("socket_tech_url")
val socketTechUrl: String
)