diff --git a/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt b/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt index bd03b1596e..5f10d0eb52 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt @@ -21,7 +21,7 @@ import com.mogo.commons.device.Devices import com.mogo.commons.network.NetConfigUtils import com.mogo.commons.network.Utils import com.mogo.eagle.core.data.config.FunctionBuildConfig -import com.mogo.eagle.core.data.constants.HostConst +import com.mogo.commons.constants.HostConst import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_LOST import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_CONNECT_SUCCESS diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt index a06f425ef2..32ab95019c 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt @@ -204,7 +204,6 @@ class MoGoAdasListenerImpl : OnAdasListener { autopilotStatusInfo.camera = autopilotState.camera autopilotStatusInfo.rtk = autopilotState.rtk autopilotStatusInfo.radar = autopilotState.radar - autopilotStatusInfo.speed = autopilotState.speed.toFloat() autopilotStatusInfo.version = AdasManager.getInstance().adasVersion if (autopilotStatusInfo.connectIP == null) { autopilotStatusInfo.connectIP = AdasManager.getInstance().ipcConnectedIp @@ -214,7 +213,6 @@ class MoGoAdasListenerImpl : OnAdasListener { } AdasManager.getInstance().carConfig?.let { autopilotStatusInfo.dockVersion = it.dockVersion - AppConfigInfo.dockerVersion = it.dockVersion } CallerLogger.d("Upgrade", "origin = ${autopilotStatusInfo.connectStatus} -----now = ${AppConfigInfo.isConnectAutopilot} ") AppConfigInfo.isConnectAutopilot = autopilotStatusInfo.connectStatus @@ -320,9 +318,11 @@ class MoGoAdasListenerImpl : OnAdasListener { ) { if (carConfigResp != null) { //todo emArrow startUp时确认数据完整性 + AppConfigInfo.dockerVersion = carConfigResp.dockVersion AppConfigInfo.plateNumber = carConfigResp.plateNumber//车牌号 AppConfigInfo.iPCMacAddress = carConfigResp.macAddress//工控机MAC地址 AppConfigInfo.protocolVersionNumber = carConfigResp.protocolVersionValue//工控机协议版本 + AppConfigInfo.isConnectAutopilot = true invokeAutopilotCarConfigData(carConfigResp) } } diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt index bac4a75aaa..4b768c122d 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt @@ -1,13 +1,10 @@ package com.mogo.eagle.core.function.autopilot.adapter -import android.annotation.SuppressLint import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.commons.debug.DebugConfig.* -import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener -import com.mogo.eagle.core.function.autopilot.network.AdasServiceModel import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager @@ -22,9 +19,6 @@ import com.zhidao.support.adas.high.common.Constants import com.zhidao.support.adas.high.common.Constants.ENVIRONMENT.* import com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.DRIVER import com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.PASSENGER -import mogo.telematics.pad.MessagePad -import java.util.* -import java.util.concurrent.atomic.AtomicBoolean /** * ADAS-SDK与工控机连接状态回调 @@ -33,18 +27,8 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener, IMoGoAutopilotStatusListener, IMoGoCloudListener { private val TAG = "ConnectStatus" - //自动驾驶状态 - private var mCurrentAutopilotStatus = -1 - - //自动驾驶车速度 - private var mCurrentAutopilotSpeed = 0f - private var connectStatus = false - private val hasUploadTaskLaunched by lazy { AtomicBoolean(false) } - - private val timer = Timer() - init { CallerCloudListenerManager.registerCloudListener(TAG, this) } @@ -65,8 +49,6 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener, CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatus = true // 同步SN给工控机 syncBasicInfoToAutopilot() - // 开启轮询上传自动驾驶状态 - updateDriveStatusTask() //每次工控机连接成功后,需同步当前设置的美化模式状态 CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode) //当连接状态是关闭美化模式时,同步给工控机 @@ -89,8 +71,6 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener, AdasManager.getInstance().ipcConnectedPort CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatus = false //与工控机断开连接,需要重置自动驾驶状态(包括上传至云平台缓存信息),等待连接成功后同步状态信息 - mCurrentAutopilotStatus = 0 - mCurrentAutopilotSpeed = 0.0f CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state = 0 CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().pilotmode = 0 } else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTING) { @@ -117,21 +97,6 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener, syncBasicInfoToAutopilot() } - override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) { - if (arrivalNotification != null && arrivalNotification.endLocation != null) { - val lon = arrivalNotification.endLocation.longitude - val lat = arrivalNotification.endLocation.latitude - AdasServiceModel.getInstance().reportSite(lon, lat) - } - } - - override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) { - val state = autoPilotStatusInfo.state - val speed = autoPilotStatusInfo.speed - mCurrentAutopilotStatus = state - mCurrentAutopilotSpeed = speed - } - /** * 同步SN信息给工控机 */ @@ -174,23 +139,6 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener, } } - /** - * 上传自动驾驶状态任务 - */ - @SuppressLint("CheckResult") - private fun updateDriveStatusTask() { - if (hasUploadTaskLaunched.compareAndSet(false, true)) { - timer.schedule(object : TimerTask() { - override fun run() { - CallerLogger.d("$M_ADAS_IMPL$TAG", "updateDriveStatusTask") - AdasServiceModel.getInstance() - .updateDriveStatus(mCurrentAutopilotStatus, mCurrentAutopilotSpeed) - } - }, 0, 5000) - } - - } - override fun tokenGot(token: String, sn: String) { syncBasicInfoToAutopilot(sn) } diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/AutonomousDriveStatusBean.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/AutonomousDriveStatusBean.java deleted file mode 100644 index ffbd292b4c..0000000000 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/AutonomousDriveStatusBean.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.mogo.eagle.core.function.autopilot.entity; - -/** - * Created by SuYong on 2021/5/28 16:12 - */ -public class AutonomousDriveStatusBean { - - private String sn; - private int status; - private float vehicleSpeed; - - public AutonomousDriveStatusBean(String sn, int status, float vehicleSpeed) { - this.sn = sn; - this.status = status; - this.vehicleSpeed = vehicleSpeed; - } - - public String getSn() { - return sn; - } - - public void setSn(String sn) { - this.sn = sn; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public float getVehicleSpeed() { - return vehicleSpeed; - } - - public void setVehicleSpeed(float vehicleSpeed) { - this.vehicleSpeed = vehicleSpeed; - } -} diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/ReportSiteBean.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/ReportSiteBean.java deleted file mode 100644 index 1d12392d24..0000000000 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/entity/ReportSiteBean.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.mogo.eagle.core.function.autopilot.entity; - -/** - * Created by SuYong on 2021/5/31 16:24 - */ -public class ReportSiteBean { - private String sn; - private double lon; - private double lat; - - public ReportSiteBean(String sn, double lon, double lat) { - this.sn = sn; - this.lon = lon; - this.lat = lat; - } - - public String getSn() { - return sn; - } - - public void setSn(String sn) { - this.sn = sn; - } - - public double getLon() { - return lon; - } - - public void setLon(double lon) { - this.lon = lon; - } - - public double getLat() { - return lat; - } - - public void setLat(double lat) { - this.lat = lat; - } -} diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/AdasServiceModel.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/AdasServiceModel.java deleted file mode 100644 index a3b2c27275..0000000000 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/AdasServiceModel.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.mogo.eagle.core.function.autopilot.network; - -import com.mogo.cloud.passport.MoGoAiCloudClientConfig; -import com.mogo.commons.context.ContextHolderUtil; -import com.mogo.eagle.core.data.BaseData; -import com.mogo.eagle.core.function.autopilot.entity.AutonomousDriveStatusBean; -import com.mogo.eagle.core.function.autopilot.entity.ReportSiteBean; -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.network.utils.GsonUtil; -import com.mogo.eagle.core.data.constants.HostConst; - -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.schedulers.Schedulers; -import okhttp3.MediaType; -import okhttp3.RequestBody; - -/** - * 将自动驾驶状态及站点信息上传给云平台,云平台会根据此数据做路线的绘制 - * - * @author dongghongyu - */ -public class AdasServiceModel { - - private static final String TAG = "AdasServiceModel"; - private static volatile AdasServiceModel instance; - private static final byte[] obj = new byte[0]; - - private final IAdasApiService mAdasApiService; - - private AdasServiceModel() { - this.mAdasApiService = MoGoRetrofitFactory.getInstance(HostConst.DATA_SERVICE_HOST).create(IAdasApiService.class); - } - - public static AdasServiceModel getInstance() { - if (instance == null) { - synchronized (obj) { - if (instance == null) { - instance = new AdasServiceModel(); - } - } - } - return instance; - } - - public void updateDriveStatus(int autoPilotStatus, float autoPilotSpeed) { - String sn = MoGoAiCloudClientConfig.getInstance().getSn(); - AutonomousDriveStatusBean request = new AutonomousDriveStatusBean(sn, autoPilotStatus, autoPilotSpeed); - RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request)); - mAdasApiService.updateAutonomousDriveStatus(requestBody). - subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) - .subscribe(new SubscribeImpl(RequestOptions.create(ContextHolderUtil.getContext())) { - @Override - public void onError(String message, int code) { - super.onError(message, code); - } - - @Override - public void onError(Throwable e) { - super.onError(e); - } - - @Override - public void onSuccess(BaseData o) { - super.onSuccess(o); - } - }); - } - - public void reportSite(double lon, double lat) { - String sn = MoGoAiCloudClientConfig.getInstance().getSn(); - ReportSiteBean reportSiteBean = new ReportSiteBean(sn, lon, lat); - RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(reportSiteBean)); - mAdasApiService.updateReportSite(requestBody). - subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) - .subscribe(new SubscribeImpl(RequestOptions.create(ContextHolderUtil.getContext())) { - @Override - public void onError(String message, int code) { - super.onError(message, code); - } - - @Override - public void onError(Throwable e) { - super.onError(e); - } - - @Override - public void onSuccess(BaseData o) { - super.onSuccess(o); - } - }); - } - -} diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/IAdasApiService.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/IAdasApiService.java deleted file mode 100644 index b9565cf782..0000000000 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/network/IAdasApiService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.mogo.eagle.core.function.autopilot.network; - -import com.mogo.eagle.core.data.BaseData; - -import io.reactivex.Observable; -import okhttp3.RequestBody; -import retrofit2.http.Body; -import retrofit2.http.Headers; -import retrofit2.http.POST; - -public interface IAdasApiService { - - /** - * 上传自动驾驶状态接口 - * @param requestBody - * @return - */ - @Headers({"Content-Type:application/json;charset=UTF-8"}) - @POST("/dataService/autonomousDrive/updateAutonomousDriveStatus") - Observable updateAutonomousDriveStatus(@Body RequestBody requestBody); - - /** - * 站点上报 用于网约车业务 云平台绘制路线使用 - * @param requestBody - * @return - */ - @Headers({"Content-Type:application/json;charset=UTF-8"}) - @POST("/dataService/autonomousDrive/reportSite") - Observable updateReportSite(@Body RequestBody requestBody); - -} diff --git a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/BindHostConst.kt b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/BindHostConst.kt deleted file mode 100644 index 04bf67be17..0000000000 --- a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/BindHostConst.kt +++ /dev/null @@ -1,26 +0,0 @@ -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 - } - } - } - -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeAppNetWorkManager.java b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeAppNetWorkManager.java index 5103ef62c7..5bf1b0d44c 100644 --- a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeAppNetWorkManager.java +++ b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeAppNetWorkManager.java @@ -5,8 +5,8 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BIN import android.content.Context; import com.mogo.cloud.passport.MoGoAiCloudClientConfig; +import com.mogo.commons.constants.HostConst; import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo; -import com.mogo.eagle.core.function.BindHostConst; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.network.MoGoRetrofitFactory; import com.mogo.eagle.core.network.utils.GsonUtil; @@ -33,7 +33,7 @@ public class UpgradeAppNetWorkManager { private UpgradeAppNetWorkManager() { - mUpgradeApiService = MoGoRetrofitFactory.getInstance(BindHostConst.getBaseUrl()) + mUpgradeApiService = MoGoRetrofitFactory.getInstance(HostConst.Companion.getHost()) .create(UpgradeApiService.class); } diff --git a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/network/BindingcarNetWorkManager.java b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/network/BindingcarNetWorkManager.java index d4b2287e7d..261e5498b2 100644 --- a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/network/BindingcarNetWorkManager.java +++ b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/network/BindingcarNetWorkManager.java @@ -3,10 +3,10 @@ package com.mogo.eagle.core.function.bindingcar.network; import android.content.Context; import android.util.Log; +import com.mogo.commons.constants.HostConst; 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.function.BindHostConst; import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.network.MoGoRetrofitFactory; @@ -35,7 +35,7 @@ public class BindingcarNetWorkManager { private static final String TAG = "BindingcarNetManager"; private BindingcarNetWorkManager() { - mBindingcarApiService = MoGoRetrofitFactory.getInstance(BindHostConst.getBaseUrl()) + mBindingcarApiService = MoGoRetrofitFactory.getInstance(HostConst.Companion.getHost()) .create(BindingcarApiService.class); } diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java index f0093f5a1b..cdd018991a 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/check/net/CheckApiServiceFactory.java @@ -1,7 +1,7 @@ package com.mogo.eagle.core.function.check.net; import com.mogo.eagle.core.network.MoGoRetrofitFactory; -import com.mogo.eagle.core.data.constants.HostConst; +import com.mogo.commons.constants.HostConst; /** * @author liujing diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/funcconfig/network/FuncConfigHost.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/funcconfig/network/FuncConfigHost.kt deleted file mode 100644 index 1d8648ec24..0000000000 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/funcconfig/network/FuncConfigHost.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.zhjt.mogo_core_function_devatools.funcconfig.network - -import com.mogo.commons.debug.DebugConfig - -class FuncConfigHost { - - companion object{ - private const val HOST_DEV = "https://eagle-qa.zhidaozhixing.com" - private const val HOST_RELEASE = "https://eagle.zhidaozhixing.com" - - fun get(): String{ - return when (DebugConfig.getNetMode()) { - DebugConfig.NET_MODE_DEV -> HOST_DEV - DebugConfig.NET_MODE_QA -> HOST_DEV - DebugConfig.NET_MODE_DEMO -> HOST_RELEASE - DebugConfig.NET_MODE_RELEASE -> HOST_RELEASE - else -> HOST_RELEASE - } - } - } - -} \ 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/funcconfig/network/FuncConfigNetWorkModel.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/funcconfig/network/FuncConfigNetWorkModel.kt index 10540e4e12..21bbdf98ba 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/funcconfig/network/FuncConfigNetWorkModel.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/funcconfig/network/FuncConfigNetWorkModel.kt @@ -1,6 +1,7 @@ package com.zhjt.mogo_core_function_devatools.funcconfig.network import com.mogo.cloud.passport.MoGoAiCloudClientConfig +import com.mogo.commons.constants.HostConst import com.mogo.eagle.core.data.BaseResponse import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.network.apiCall @@ -11,7 +12,7 @@ import com.zhjt.service_biz.FuncConfig class FuncConfigNetWorkModel { - private fun getNetWorkApi(baseUrl: String = FuncConfigHost.get()): FuncConfigApiService { + private fun getNetWorkApi(baseUrl: String = HostConst.getHost()): FuncConfigApiService { return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl) .create(FuncConfigApiService::class.java) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/network/UpgradeVersionNetWorkModel.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/network/UpgradeVersionNetWorkModel.kt index 6170901949..2aad01f127 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/network/UpgradeVersionNetWorkModel.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/upgrade/network/UpgradeVersionNetWorkModel.kt @@ -4,7 +4,7 @@ import com.mogo.eagle.core.data.Response import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.network.apiResponseCall import com.mogo.eagle.core.network.request -import com.mogo.eagle.core.data.constants.HostConst +import com.mogo.commons.constants.HostConst import com.zhjt.mogo_core_function_devatools.upgrade.network.HostConst.Companion.getBaseUrl class UpgradeVersionNetWorkModel { diff --git a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/model/DispatchServiceModel.java b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/model/DispatchServiceModel.java index e214e9a3ab..64e488cf90 100644 --- a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/model/DispatchServiceModel.java +++ b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/model/DispatchServiceModel.java @@ -1,7 +1,7 @@ package com.zhjt.dispatch.model; import static com.mogo.commons.context.ContextHolderUtil.getContext; -import static com.mogo.eagle.core.data.constants.HostConst.DATA_SERVICE_HOST; +import static com.mogo.commons.constants.HostConst.DATA_SERVICE_HOST; import com.mogo.cloud.passport.MoGoAiCloudClientConfig; import com.mogo.eagle.core.data.BaseData; diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/OverViewConst.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/OverViewConst.kt deleted file mode 100644 index cefa2c5968..0000000000 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/OverViewConst.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.mogo.eagle.core.function.overview - -class OverViewConst { - companion object { - const val CLOUD_HOST = "https://eagle-qa.zhidaozhixing.com" - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/vm/OverViewModel.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/vm/OverViewModel.kt index f6102fc24c..4cdff6fe9b 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/vm/OverViewModel.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/vm/OverViewModel.kt @@ -1,8 +1,8 @@ package com.mogo.eagle.core.function.overview.vm import androidx.lifecycle.* +import com.mogo.commons.constants.HostConst import com.mogo.eagle.core.data.map.Infrastructure -import com.mogo.eagle.core.function.overview.OverViewConst import com.mogo.eagle.core.function.overview.OverviewDao import com.mogo.eagle.core.function.overview.remote.OverViewServiceApi import com.mogo.eagle.core.function.overview.remote.V2XEvent @@ -10,7 +10,6 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory import io.reactivex.Observable import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable -import io.reactivex.functions.Consumer import io.reactivex.schedulers.Schedulers import kotlinx.coroutines.launch import java.util.concurrent.TimeUnit @@ -79,7 +78,7 @@ class OverViewModel( // 1分钟查询一次 disposable = Observable.interval(0, 60000, TimeUnit.SECONDS) .flatMap { - MoGoRetrofitFactory.getInstance(OverViewConst.CLOUD_HOST) + MoGoRetrofitFactory.getInstance(HostConst.getHost()) .create(OverViewServiceApi::class.java) .queryAllV2XEventsByLineId(lineId, sn) .map { diff --git a/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/monitoring/CronTaskManager.kt b/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/monitoring/CronTaskManager.kt index 6608dd9c18..93f95cdd3d 100644 --- a/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/monitoring/CronTaskManager.kt +++ b/core/function-impl/mogo-core-function-monitoring/src/main/java/com/mogo/eagle/core/function/monitoring/CronTaskManager.kt @@ -12,7 +12,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MONITOR import com.mogo.map.MogoLocationClient -import com.mogo.eagle.core.data.constants.HostConst +import com.mogo.commons.constants.HostConst import io.reactivex.Observable import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/network/V2XApiServiceFactory.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/network/V2XApiServiceFactory.java index b20266d1f5..354cea4a28 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/network/V2XApiServiceFactory.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/network/V2XApiServiceFactory.java @@ -1,7 +1,7 @@ package com.mogo.eagle.core.function.v2x.events.network; import com.mogo.eagle.core.network.MoGoRetrofitFactory; -import com.mogo.eagle.core.data.constants.HostConst; +import com.mogo.commons.constants.HostConst; /** * 应对不同接口对应不同服务域名的工厂累 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/network/TrafficLightNetWorkModel.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/network/TrafficLightNetWorkModel.kt index 880ecafd32..af653fec0b 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/network/TrafficLightNetWorkModel.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/network/TrafficLightNetWorkModel.kt @@ -8,7 +8,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.network.apiCall import com.mogo.eagle.core.network.cancel import com.mogo.eagle.core.network.request -import com.mogo.eagle.core.data.constants.HostConst.CITY_HOST +import com.mogo.commons.constants.HostConst.CITY_HOST class TrafficLightNetWorkModel { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/network/VipNetWorkModel.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/network/VipNetWorkModel.kt index 350a24dc78..20d2104864 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/network/VipNetWorkModel.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/network/VipNetWorkModel.kt @@ -6,7 +6,7 @@ import com.mogo.eagle.core.data.v2x.VipRequest import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.network.apiCall import com.mogo.eagle.core.network.request -import com.mogo.eagle.core.data.constants.HostConst.DATA_SERVICE_HOST +import com.mogo.commons.constants.HostConst.DATA_SERVICE_HOST class VipNetWorkModel { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt index f0dd46a78b..e336af0e30 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt @@ -46,11 +46,6 @@ open class AutopilotStatusInfo : Serializable, Cloneable { @Volatile var satelliteTime = 0.0 - /** - * 车速 m/s - */ - var speed = 0f - /** * 自动驾驶状态 0是不可用 1是ready 2是自动驾驶start */ @@ -94,7 +89,7 @@ open class AutopilotStatusInfo : Serializable, Cloneable { return "connectIP=$connectIP, connectPort=$connectPort, " + "connectStatus=$connectStatus, connectDescribe=$connectStatusDescribe, version=$version, dockVersion=$dockVersion," + " locationStatus=$locationStatus), locationLat=$locationLat, locationLon=$locationLon," + - " satelliteTime=$satelliteTime, speed=$speed, state=$state, reason=$reason, camera=$camera," + + " satelliteTime=$satelliteTime, state=$state, reason=$reason, camera=$camera," + " radar=$radar, rtk=$rtk, pilotmode=$pilotmode, ipcConnStatus=$ipcConnStatus, autopilotControlParameters=$autopilotControlParameters" } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/HostConst.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/HostConst.java deleted file mode 100644 index b5ca4488e6..0000000000 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/HostConst.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.mogo.eagle.core.data.constants; - -/** - * 通用接口请求host - * - * @author tong - */ -public class HostConst { - public static final String DEVA_HOST = "http://dzt-deva.zhidaozhixing.com"; - public static final String LAUNCHER_SNAPSHOT_HOST = "http://dzt-launcherSnapshot.zhidaozhixing.com"; - public static final String DATA_SERVICE_HOST = "http://dzt-dataService.zhidaozhixing.com"; - public static final String REALTIME_LOCATION_HOST = "http://dzt-realtimeLocation.zhidaozhixing.com"; - public static final String GEOFENCE_HOST = "http://dzt-geoFenceCarService.zhidaozhixing.com"; - public static final String CARLIFE_HOST = "http://dzt-carlife.zhidaozhixing.com"; - public static final String STRATEGY_PUSH_HOST = "http://dzt-strategyPush.zhidaozhixing.com"; - public static final String CAMERA_STREAM_HOST = "http://dzt-smartTransportationAiCloud.zhidaozhixing.com"; - public static final String OPEN_CAMERA_STREAM_HOST = "http://10.0.16.6:18080"; - - public static final String CITY_HOST = "http://dzt-city.zhidaozhixing.com"; - public static final String SOCKET_CENTER_DOMAIN = "socketRegion"; - -// public static final String UPGRADE_APP_HOST_TEST = "http://10.0.200.12:32423?/"; - public static final String UPGRADE_APP_HOST = "http://eagle-mis.zhidaozhixing.com/"; - - public static final String CMDB_HOST = "http://eagle-mis.zhidaozhixing.com/eagleEye-mis/cmdbapi/"; - - -} diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.kt b/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.kt new file mode 100644 index 0000000000..d134c4ac51 --- /dev/null +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/constants/HostConst.kt @@ -0,0 +1,36 @@ +package com.mogo.commons.constants + +import com.mogo.commons.debug.DebugConfig + +/** + * 通用接口请求host + */ +class HostConst { + companion object{ + const val DEVA_HOST = "http://dzt-deva.zhidaozhixing.com" + const val DATA_SERVICE_HOST = "http://dzt-dataService.zhidaozhixing.com" + const val REALTIME_LOCATION_HOST = "http://dzt-realtimeLocation.zhidaozhixing.com" + const val GEOFENCE_HOST = "http://dzt-geoFenceCarService.zhidaozhixing.com" + const val STRATEGY_PUSH_HOST = "http://dzt-strategyPush.zhidaozhixing.com" + const val CAMERA_STREAM_HOST = "http://dzt-smartTransportationAiCloud.zhidaozhixing.com" + const val OPEN_CAMERA_STREAM_HOST = "http://10.0.16.6:18080" + const val CITY_HOST = "http://dzt-city.zhidaozhixing.com" + const val SOCKET_CENTER_DOMAIN = "socketRegion" + + // public static final String UPGRADE_APP_HOST_TEST = "http://10.0.200.12:32423?/"; + const val CMDB_HOST = "http://eagle-mis.zhidaozhixing.com/eagleEye-mis/cmdbapi/" + + private const val HOST_DEV = "https://eagle-qa.zhidaozhixing.com" + private const val HOST_RELEASE = "https://eagle-mis.zhidaozhixing.com" + + fun getHost():String{ + return when (DebugConfig.getNetMode()) { + DebugConfig.NET_MODE_DEV -> HOST_DEV + DebugConfig.NET_MODE_QA -> HOST_DEV + DebugConfig.NET_MODE_DEMO -> HOST_RELEASE + DebugConfig.NET_MODE_RELEASE -> HOST_RELEASE + else -> HOST_RELEASE + } + } + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 91c4f15541..d9d4f30730 100644 --- a/gradle.properties +++ b/gradle.properties @@ -63,7 +63,7 @@ BIZCONFIG_VERSION=1.3.2 SERVICE_BIZ_VERSION=1.2.4 ################ 外部依赖引用 ################ # loglib -LOGLIB_VERSION=1.5.7 +LOGLIB_VERSION=1.5.8 ######## MogoAiCloudSDK Version ######## # 网络请求LOGLIB_VERSION MOGO_NETWORK_VERSION=1.4.3.26