删除无用代码
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
package com.mogo.eagle.core.function.check.net;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
@@ -12,12 +13,7 @@ import com.mogo.service.network.IMogoNetwork;
|
||||
* @since: 8/13/21
|
||||
*/
|
||||
public class CheckApiServiceFactory {
|
||||
private static CheckApiServices mDevaApiService;
|
||||
private static CheckApiServices mDataApiService;
|
||||
private static CheckApiServices mLauncherSnapshotApiService;
|
||||
private static CheckApiServices mGeoFenceCarServiceApiService;
|
||||
private static CheckApiServices mRealtimeLocationApiService;
|
||||
private static CheckApiServices mDataServiceApiService;
|
||||
|
||||
/**
|
||||
* 获取指定域名下的 API 服务
|
||||
@@ -29,17 +25,6 @@ public class CheckApiServiceFactory {
|
||||
return network.create(CheckApiServices.class, netHost);
|
||||
}
|
||||
|
||||
public static CheckApiServices getDevaApiService(Context context) {
|
||||
if (mDevaApiService == null) {
|
||||
synchronized (CheckApiServiceFactory.class) {
|
||||
if (mDevaApiService == null) {
|
||||
mDevaApiService = getApiService(context, HostConst.DEVA_HOST);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mDevaApiService;
|
||||
}
|
||||
|
||||
public static CheckApiServices getDataApiService(Context context) {
|
||||
if (mDataApiService == null) {
|
||||
synchronized (CheckApiServiceFactory.class) {
|
||||
@@ -51,58 +36,4 @@ public class CheckApiServiceFactory {
|
||||
return mDataApiService;
|
||||
}
|
||||
|
||||
public static CheckApiServices getLauncherSnapshotApiService(Context context) {
|
||||
if (mLauncherSnapshotApiService == null) {
|
||||
synchronized (CheckApiServiceFactory.class) {
|
||||
if (mLauncherSnapshotApiService == null) {
|
||||
mLauncherSnapshotApiService = getApiService(context, HostConst.LAUNCHER_SNAPSHOT_HOST);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mLauncherSnapshotApiService;
|
||||
}
|
||||
|
||||
public static CheckApiServices getGeoFenceCarServiceApiService(Context context) {
|
||||
if (mGeoFenceCarServiceApiService == null) {
|
||||
synchronized (CheckApiServiceFactory.class) {
|
||||
if (mGeoFenceCarServiceApiService == null) {
|
||||
mGeoFenceCarServiceApiService = getApiService(context, HostConst.GEOFENCE_HOST);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mGeoFenceCarServiceApiService;
|
||||
}
|
||||
|
||||
public static CheckApiServices getRealtimeLocationApiService(Context context) {
|
||||
if (mRealtimeLocationApiService == null) {
|
||||
synchronized (CheckApiServiceFactory.class) {
|
||||
if (mRealtimeLocationApiService == null) {
|
||||
mRealtimeLocationApiService = getApiService(context, HostConst.REALTIME_LOCATION_HOST);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mRealtimeLocationApiService;
|
||||
}
|
||||
|
||||
public static CheckApiServices getDataServiceApiService(Context context) {
|
||||
if (mDataServiceApiService == null) {
|
||||
synchronized (CheckApiServiceFactory.class) {
|
||||
if (mDataServiceApiService == null) {
|
||||
mDataServiceApiService = getApiService(context, HostConst.DATA_SERVICE_HOST);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mDataServiceApiService;
|
||||
}
|
||||
public static CheckApiServices getStrategyPushApiService(Context context) {
|
||||
if (mDataServiceApiService == null) {
|
||||
synchronized (CheckApiServiceFactory.class) {
|
||||
if (mDataServiceApiService == null) {
|
||||
mDataServiceApiService = getApiService(context, HostConst.STRATEGY_PUSH_HOST);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mDataServiceApiService;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,11 +19,13 @@ import io.reactivex.schedulers.Schedulers
|
||||
*/
|
||||
|
||||
object CheckNetWork {
|
||||
|
||||
//网络请求,获取自车检测结果(工控机上报云端)
|
||||
fun checkNetWork(context: Context, callbackFlow: ICheckResultCallBack) {
|
||||
val params = ParamsBuilder.of(false)
|
||||
.append("sn", MoGoAiCloudClientConfig.getInstance().sn)
|
||||
.build()
|
||||
|
||||
CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(params)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
Reference in New Issue
Block a user