From 15f3a7b068a010d8415c29d07f71c423eb9f5c14 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Mon, 16 Mar 2026 18:14:23 +0800 Subject: [PATCH] =?UTF-8?q?[8.4.0]=20[=E5=8D=87=E7=BA=A7]=20[=E6=94=AF?= =?UTF-8?q?=E6=8C=81mis=E5=92=8Cmyflow=20=E5=8D=87=E7=BA=A7]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config/urlConfig.json | 8 ++ .../binding/BindingCarManager.kt | 4 + .../upgrade/UpgradeApiService.kt | 10 ++ .../upgrade/UpgradeAppMyFlowRequest.java | 34 ++++++ .../upgrade/UpgradeAppNetWorkManager.kt | 111 ++++++++++++++++-- .../com/mogo/eagle/core/data/app/UrlConfig.kt | 2 + .../data/deva/bindingcar/AppInfoMyFlow.kt | 28 +++++ .../data/deva/bindingcar/UpgradeAppInfo.java | 10 ++ .../utilcode/mogo/AppIdentityModeUtils.kt | 12 ++ .../com/mogo/commons/constants/HostConst.java | 19 +++ .../constants/SharedPrefsConstants.java | 4 +- 11 files changed, 228 insertions(+), 14 deletions(-) create mode 100644 core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppMyFlowRequest.java create mode 100644 core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/bindingcar/AppInfoMyFlow.kt diff --git a/app/config/urlConfig.json b/app/config/urlConfig.json index 1ff2715885..518590118b 100644 --- a/app/config/urlConfig.json +++ b/app/config/urlConfig.json @@ -9,6 +9,7 @@ "socket_tech_url": "http://tech-qa.zhidaozhixing.com/", "eagle_mis_url": "", "eagle_dns_url": "", + "myflow_url": "http://gateway.ee-private-dev1.myghost.zhidaoauto.com", "bind_driver_qr_url": "", "chart_socket_url":"", "nde_url":"https://nde-qa-city.zhidaozhixing.com", @@ -27,6 +28,7 @@ "socket_tech_url": "http://tech.zhidaozhixing.com/", "eagle_mis_url": "", "eagle_dns_url": "", + "myflow_url": "https://xjp-myflows.zhidaozhixing.com", "bind_driver_qr_url": "", "chart_socket_url":"", "nde_url":"https://nde-qa-city.zhidaozhixing.com", @@ -47,6 +49,7 @@ "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", "eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/", "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/", + "myflow_url": "http://gateway.ee-private-dev1.myghost.zhidaoauto.com", "bind_driver_qr_url": "https://och-mini-eh.zhidaozhixing.com?pipe=ehsafety&sn=%1$s", "chart_socket_url":"wss://acp-eh.zhidaozhixing.com/ws", "nde_url":"https://nde-qa-city.zhidaozhixing.com", @@ -65,6 +68,7 @@ "socket_tech_url": "https://och-driver-eh.zhidaozhixing.com/arch/", "eagle_mis_url": "https://och-hailing-eh.zhidaozhixing.com/", "eagle_dns_url": "https://och-hailing-eh.zhidaozhixing.com/", + "myflow_url": "https://xjp-myflows.zhidaozhixing.com", "bind_driver_qr_url": "https://och-mini-eh.zhidaozhixing.com?pipe=ehsafety&sn=%1$s", "chart_socket_url":"wss://acp-eh.zhidaozhixing.com/ws", "nde_url":"https://nde-qa-city.zhidaozhixing.com", @@ -85,6 +89,7 @@ "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", "eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/", "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/", + "myflow_url": "http://gateway.ee-private-dev1.myghost.zhidaoauto.com", "bind_driver_qr_url": "https://och-mini-yt.zhidaozhixing.com?pipe=ytsafety&sn=%1$s", "chart_socket_url":"", "nde_url":"https://nde-qa-city.zhidaozhixing.com", @@ -103,6 +108,7 @@ "socket_tech_url": "https://och-driver-yt.zhidaozhixing.com/arch/", "eagle_mis_url": "https://och-hailing-yt.zhidaozhixing.com/", "eagle_dns_url": "https://och-hailing-yt.zhidaozhixing.com/", + "myflow_url": "https://xjp-myflows.zhidaozhixing.com", "bind_driver_qr_url": "https://och-mini-yt.zhidaozhixing.com?pipe=ytsafety&sn=%1$s", "chart_socket_url":"", "nde_url":"https://nde-qa-city.zhidaozhixing.com", @@ -122,6 +128,7 @@ "socket_tech_url": "https://mogogo-driver-qa.zhidaozhixing.com/arch/", "eagle_mis_url": "https://mogogo-qa.zhidaozhixing.com/", "eagle_dns_url": "https://mogogo-qa.zhidaozhixing.com/", + "myflow_url": "http://gateway.ee-private-dev1.myghost.zhidaoauto.com", "bind_driver_qr_url": "https://och-mini-mogogo.zhidaozhixing.com?pipe=mogogosafety&sn=%1$s", "chart_socket_url":"", "nde_url":"https://nde-qa-city.zhidaozhixing.com", @@ -139,6 +146,7 @@ "socket_tech_url": "https://mogogo-driver.zhidaozhixing.com/arch/", "eagle_mis_url": "https://mogogo.zhidaozhixing.com/", "eagle_dns_url": "https://mogogo.zhidaozhixing.com/", + "myflow_url": "https://xjp-myflows.zhidaozhixing.com", "bind_driver_qr_url": "https://och-mini-mogogo.zhidaozhixing.com?pipe=mogogosafety&sn=%1$s", "chart_socket_url":"", "nde_url":"https://nde-qa-city.zhidaozhixing.com", diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarManager.kt index 2c388400a5..39b08fb532 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarManager.kt @@ -212,6 +212,9 @@ object BindingCarManager : IMoGoAutopilotCarConfigListener, IMoGoCloudListener { /** * 查询app是否需要升级 + * ①:设置车辆类型和车辆业务模式后也请求一次 + * ②:页面点击版本号后升级 + * ③:连接车辆后 向地盘查询信息 地盘返回信息后查询更新包 */ fun queryAppUpgrade(block: ((Boolean, String?) -> Unit)?) { CallerLogger.d(M_DEVA + "UPGRADE", "---- 1 ----") @@ -228,6 +231,7 @@ object BindingCarManager : IMoGoAutopilotCarConfigListener, IMoGoCloudListener { CallerLogger.d(M_DEVA + "UPGRADE", "---- 3 ----[mac: $macAddress]") UpgradeAppNetWorkManager.instance ?.getAppUpgradeInfo(mContext, macAddress, AppIdentityModeUtils.getMisChannelCode(FunctionBuildConfig.appIdentityMode).toString() + "", block) + UpgradeAppNetWorkManager.instance?.getAppUpgradeInfoMyFlow(mContext, block) } } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeApiService.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeApiService.kt index cdca916551..d6c6e1aaaa 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeApiService.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeApiService.kt @@ -20,4 +20,14 @@ interface UpgradeApiService { @Headers("Content-Type:application/json;charset=UTF-8") @POST("eagleEye-mis/config/versionInfo") suspend fun getUpgradeInfo(@Body requestBody: RequestBody): UpgradeAppInfo + + /** + * 获取升级信息 + * , @Query("resources") String i + * @return [UpgradeAppInfo] + */ + @Headers("Content-Type:application/json;charset=UTF-8") + @POST("api/deploy/openapi/checkForAppUpdate") + suspend fun getUpgradeInfo4Myflow(@Body requestBody: UpgradeAppMyFlowRequest): UpgradeAppInfo + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppMyFlowRequest.java b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppMyFlowRequest.java new file mode 100644 index 0000000000..ff93632209 --- /dev/null +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppMyFlowRequest.java @@ -0,0 +1,34 @@ +package com.zhjt.mogo_core_function_devatools.upgrade; + +import java.io.Serializable; + +/** + * @author lixiaopeng + * @description 获取app升级信息 + * @since: 11/15/21 + */ +public class UpgradeAppMyFlowRequest implements Serializable { + private String sn; + private String appType; + + public UpgradeAppMyFlowRequest(String sn, String appType) { + this.sn = sn; + this.appType = appType; + } + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } + + public String getAppType() { + return appType; + } + + public void setAppType(String appType) { + this.appType = appType; + } +} diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppNetWorkManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppNetWorkManager.kt index 85e170897c..1c43f8c92a 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppNetWorkManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/UpgradeAppNetWorkManager.kt @@ -1,12 +1,9 @@ package com.zhjt.mogo_core_function_devatools.upgrade import android.content.* -import android.content.pm.PackageManager -import android.os.Build import android.text.TextUtils import android.util.* import android.widget.Toast -import androidx.annotation.RequiresApi import com.mogo.commons.constants.* import com.mogo.commons.utils.* import com.mogo.eagle.core.data.config.* @@ -26,6 +23,8 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.getMisChannelCode import com.mogo.eagle.core.utilcode.mogo.logger.scene.* import com.mogo.commons.storage.SharedPrefsMgr +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager +import com.mogo.eagle.core.utilcode.mogo.getMisChannelType import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.eagle.core.utilcode.util.* import com.mogo.eagle.core.utilcode.util.FileUtils @@ -42,7 +41,9 @@ import java.util.concurrent.TimeUnit */ class UpgradeAppNetWorkManager private constructor() { - private val mUpgradeApiService: UpgradeApiService = MoGoRetrofitFactory.getInstance(HostConst.getHost()).create(UpgradeApiService::class.java) + + private val mUpgradeApiService: UpgradeApiService by lazy { MoGoRetrofitFactory.getInstance(HostConst.getHost()).create(UpgradeApiService::class.java) } + private val mUpgradeMyFlowApiService: UpgradeApiService by lazy { MoGoRetrofitFactory.getInstance(HostConst.getMyFlowHost()).create(UpgradeApiService::class.java) } private val scope by lazy { CoroutineScope(Dispatchers.IO + SupervisorJob()) } @@ -50,6 +51,7 @@ class UpgradeAppNetWorkManager private constructor() { @Volatile private var upgradeJob: Job? = null + private var upgradeMyFlowJob: Job? = null // 标识静默升级是否已触发下载,如果为true, 直接返回,防止重复下载 @Volatile @@ -109,13 +111,14 @@ class UpgradeAppNetWorkManager private constructor() { provider?.recordUpgradeRequestStart() val info = mUpgradeApiService.getUpgradeInfo(requestBody) val response = GsonUtils.toJson(info) + Log.d(TAG,"MIS网络请求返回:${response}") SharedPrefsMgr.getInstance().putString(SharedPrefsConstants.APP_UPGRADE_CONTENT, if (info.result != null) response + "--mac:$macAddress --type:$type --sn:$sn --versionName:$versionName" else "info.result == null --mac:$macAddress --type:$type --sn:$sn --versionName:$versionName --versionCode:$versionCode") if (info.result != null) { runCatching { block?.invoke(true, response) } provider?.recordUpgradeRequestSuccess(response) - doUpgrade(info) + doUpgrade(info.result) } else { // val error = info.msg?:"请检查升级服务日志" val error = info.msg?:StringUtils.getString(com.mogo.eagle.core.widget.R.string.module_core_check_upgrade_log_normal) @@ -125,6 +128,7 @@ class UpgradeAppNetWorkManager private constructor() { provider?.recordUpgradeRequestFailed(error) } } catch (t: Throwable) { + Log.d(TAG,"MIS网络请求返回:错误信息:${t.message}") t.printStackTrace() SharedPrefsMgr.getInstance().putString(SharedPrefsConstants.APP_UPGRADE_CONTENT, "$t--mac:$macAddress --type:$type --sn:$sn " @@ -143,13 +147,94 @@ class UpgradeAppNetWorkManager private constructor() { } } - private suspend fun doUpgrade(info: UpgradeAppInfo) { - if (info.result != null) { + + fun getAppUpgradeInfoMyFlow(context: Context?, block: ((Boolean, String?) -> Unit)? = null) { + Logger.d(TAG, "myflow vin address is null or empty.---------") + upgradeMyFlowJob?.safeCancel() + scope.launch { + var tempVin = CallerAutoPilotControlManager.getVIN() ?: "" + var type = AppIdentityModeUtils.getMisChannelType(FunctionBuildConfig.appIdentityMode) //"10" + while (TextUtils.isEmpty(tempVin)) { + Logger.d(TAG, "myflow vin address is null or empty.") + MogoAnalyticUtils.track("AppUpgradeParamsMyFlow", HashMap().also { it["vin"] = tempVin }) + delay(TimeUnit.MINUTES.toMillis(1)) + tempVin = CallerAutoPilotControlManager.getVIN() ?: "" + } + while (TextUtils.isEmpty(type)) { + Logger.d(TAG, "myflow type is 0") + delay((TimeUnit.MINUTES.toMillis(1))) + MogoAnalyticUtils.track("AppUpgradeParamsMyFLow", HashMap().also { it["type"] = type }) + type = AppIdentityModeUtils.getMisChannelType(FunctionBuildConfig.appIdentityMode).toString() + } + Logger.d(TAG, "myflow start upgrade request ...") + SharedPrefsMgr.getInstance().putString(SharedPrefsConstants.HOST_ADDRESS_MyFLow, HostConst.getMyFlowHost()) + try { + val records = provider?.getUpgradeRecords()?.also { + MogoAnalyticUtils.track("AppUpgradeRecord", TreeMap().also { itx -> + it.entries.forEach { entry -> + itx[entry.key] = entry.value.joinToString(",") { + "${ it.first } -> ${ it.second }" + } + } + itx["role"] = type + }) + } + Log.d(TAG, "myflow getAppUpgradeInfo: -> records:" + records?.entries?.joinToString(",") { itx -> "key:${itx.key} -> value:[${itx.value.joinToString(",") { "${it.first},${it.second}" } }]"}) + val latestMacAddress = CallerAutoPilotControlManager.getVIN() + if (!TextUtils.equals(latestMacAddress, tempVin)) { + tempVin = latestMacAddress + } + Log.d(SceneConstant.M_DEVA + TAG, "myflow getAppUpgradeInfo vin = $tempVin---type = $type") + val request = UpgradeAppMyFlowRequest(tempVin, type) + val requestJson = GsonUtil.jsonFromObject(request) + val requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), requestJson) + provider?.recordUpgradeRecord(tempVin ?: "", "", type, FunctionBuildConfig.isSupportPatchUpgrade) + provider?.recordUpgradeRequestStart() + Log.d(TAG,"MyFLow网络请求参数:${requestJson}") + val info = mUpgradeMyFlowApiService.getUpgradeInfo4Myflow(request) + val response = GsonUtils.toJson(info) + Log.d(TAG,"MyFLow网络请求返回:${response}") + SharedPrefsMgr.getInstance().putString(SharedPrefsConstants.APP_UPGRADE_CONTENT_MyFlow, if (info.result != null) response + "--vin:$tempVin" else "info.result == null --vin:$tempVin --type:$type") + if (info.data != null) { + runCatching { + block?.invoke(true, response) + } + provider?.recordUpgradeRequestSuccess(response) + doUpgrade(info.data.toAppInfo()) + } else { +// val error = info.msg?:"请检查升级服务日志" + val error = info.msg?:StringUtils.getString(com.mogo.eagle.core.widget.R.string.module_core_check_upgrade_log_normal) + runCatching { + block?.invoke(false, error) + } + provider?.recordUpgradeRequestFailed(error) + } + } catch (t: Throwable) { + Log.d(TAG,"MyFLow网络请求返回:错误信息:${t.message}") + t.printStackTrace() + SharedPrefsMgr.getInstance().putString(SharedPrefsConstants.APP_UPGRADE_CONTENT, "$t--vin:$tempVin --type:$type ") +// provider?.recordUpgradeRequestFailed(t.message ?: "更新接口请求失败") + provider?.recordUpgradeRequestFailed(t.message ?: StringUtils.getString(com.mogo.eagle.core.widget.R.string.module_core_update_api_request_failed)) + deleteApkFile() + } + delay(TimeUnit.HOURS.toMillis(1)) + if (mDownloadRequested) { + mDownloadRequested = false + } + getAppUpgradeInfoMyFlow(context) + }.also { + upgradeMyFlowJob = it + } + } + + + private suspend fun doUpgrade(result: AppInfo?) { + if (result != null) { val versionCode = AppUtils.getAppVersionCode() - Log.d(SceneConstant.M_DEVA + TAG, "UpgradeAppInfo url = " + info.result.appUrl + "----code = " + info.result.versionCode + "--versionCode =" + versionCode + "--info.result = " + info.result) - if (info.result.versionCode > versionCode) { - val patchInfo = info.result.patchInfo - var downloadUrl: String = info.result.appUrl + Log.d(SceneConstant.M_DEVA + TAG, "UpgradeAppInfo url = " + result.appUrl + "----code = " + result.versionCode + "--versionCode =" + versionCode + "--info.result = " + result) + if (result.versionCode > versionCode) { + val patchInfo = result.patchInfo + var downloadUrl: String = result.appUrl val provider = upgradeProvider() var isGoFullUpgrade = true if (patchInfo != null) { @@ -185,7 +270,7 @@ class UpgradeAppNetWorkManager private constructor() { } if (isGoFullUpgrade) { Log.d("ApkInstaller", "走全量升级 --- 1 ----") - provider?.recordUpgradeRecord(info.result.versionName, null, 0) + provider?.recordUpgradeRecord(result.versionName, null, 0) } //系统安装所有APP列表埋点统计 installedInfoAnalytics() @@ -214,7 +299,7 @@ class UpgradeAppNetWorkManager private constructor() { } } activity?.lifeCycleScope?.launchWhenResumed { - showUpgradeDialog(downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1), downloadUrl, info.result.installTitle, info.result.installContent, info.result.installType) + showUpgradeDialog(downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1), downloadUrl, result.installTitle, result.installContent, result.installType) } } } else { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/app/UrlConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/app/UrlConfig.kt index 9fea98dd89..e9c6e46d67 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/app/UrlConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/app/UrlConfig.kt @@ -19,6 +19,8 @@ data class UrlConfig( val eagleMisUrl: String, @SerializedName("eagle_dns_url") val eagleDnsUrl: String, + @SerializedName("myflow_url") + val myflowUrl: String, @SerializedName("bind_driver_qr_url") val bindDriverQRUrl: String, @SerializedName("chart_socket_url") diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/bindingcar/AppInfoMyFlow.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/bindingcar/AppInfoMyFlow.kt new file mode 100644 index 0000000000..47262a0a54 --- /dev/null +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/bindingcar/AppInfoMyFlow.kt @@ -0,0 +1,28 @@ +package com.mogo.eagle.core.data.deva.bindingcar + +data class AppInfoMyFlow( + val appType: String, + val artifactId: Int, + val fileAddr: String, + val hashType: String, + val hashValue: String, + val notifyMsg: String, + val product: String, + val sn: String, + val taskItemId: Int?, + val versionCode: Int?, + val versionNo: String +){ + fun toAppInfo():AppInfo{ + val appInfo = AppInfo() + appInfo.appUrl = fileAddr + appInfo.versionCode = versionCode?:0 + appInfo.versionName = versionNo + appInfo.screenType = appType + appInfo.installTitle = "版本升级" + appInfo.installContent = notifyMsg + appInfo.installType = "1" + appInfo.appFileName = product + return appInfo + } +} \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/bindingcar/UpgradeAppInfo.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/bindingcar/UpgradeAppInfo.java index 40f1a1cd41..6010f78214 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/bindingcar/UpgradeAppInfo.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/bindingcar/UpgradeAppInfo.java @@ -20,6 +20,16 @@ public class UpgradeAppInfo extends BaseData { public AppInfo result; + public AppInfoMyFlow data; + + public AppInfoMyFlow getData() { + return data; + } + + public void setData(AppInfoMyFlow data) { + this.data = data; + } + public void setResult(AppInfo data) { this.result = data; } diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt index 910d176f04..4eefac0b93 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/AppIdentityModeUtils.kt @@ -15,6 +15,18 @@ fun AppIdentityModeUtils.getMisChannelCode(appIdentityMode: String): Int { } } +/** + * 取值要与mis后台配置对应上 + * https://mogogo.zhidaozhixing.com/eagleEye-mis/appInfo/query/all?keyWord=&pageNum=1&pageSize=20 + */ +fun AppIdentityModeUtils.getMisChannelType(appIdentityMode: String): String { + return when { + isPassenger(appIdentityMode) -> "PASSENGER_APP" // 出租乘客端 + isDriver(appIdentityMode) -> "DRIVER_APP" // 出租司机端 + else -> "" + } +} + /** * 根据 * diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java index 79c70308f3..354b385654 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.java @@ -4,6 +4,9 @@ import com.mogo.commons.debug.DebugConfig; import com.mogo.eagle.core.data.config.FunctionBuildConfig; public class HostConst { + public static final String HOST_MYFLOW_UPDATE_DEV = "http://gateway.ee-private-dev1.myghost.zhidaoauto.com"; + public static final String HOST_MYFLOW_UPDATE_RELEASE = "https://xjp-myflows.zhidaozhixing.com"; + public static final String HOST_DEV = "https://eagle-qa.zhidaozhixing.com"; public static final String HOST_RELEASE = "https://eagle-mis.zhidaozhixing.com"; @@ -32,6 +35,22 @@ public class HostConst { } + public static String getMyFlowHost() { + String host = HOST_MYFLOW_UPDATE_RELEASE; + if (FunctionBuildConfig.urlJson.getMyflowUrl().isEmpty()) { + switch (DebugConfig.getNetMode()) { + case DebugConfig.NET_MODE_DEV: + case DebugConfig.NET_MODE_QA: + host = HOST_MYFLOW_UPDATE_DEV; + break; + } + return host; + } else { + return FunctionBuildConfig.urlJson.getMyflowUrl(); + } + } + + public static String getEagleHost() { String host = HOST_EAGLE_RELEASE; if (FunctionBuildConfig.urlJson.getEagleDnsUrl().isEmpty()) { diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/SharedPrefsConstants.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/SharedPrefsConstants.java index e9b43b21ac..57b1c122c6 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/SharedPrefsConstants.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/SharedPrefsConstants.java @@ -14,8 +14,10 @@ public class SharedPrefsConstants { public static final String CAR_INFO = "car_info"; - public static final String HOST_ADDRESS = "host_address"; + public static final String HOST_ADDRESS = "host_address_update"; + public static final String HOST_ADDRESS_MyFLow = "host_address_update_myflow"; public static final String APP_UPGRADE_CONTENT = "app_upgrade_content"; + public static final String APP_UPGRADE_CONTENT_MyFlow = "app_upgrade_content_myflow"; public static final String APP_MAC = "app_mac";