[fea]
[退出登录链条]
This commit is contained in:
yangyakun
2024-09-23 15:16:53 +08:00
parent bb1f2279d5
commit 91389d308a
5 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package com.mogo.och.common.module.manager.transform
import com.mogo.eagle.core.function.api.och.IOchCommonFunctionCall
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.function.call.och.CallerOchFunctionCallManager
object OchTransform : CallerBase<OchTransformDispatch>(),IOchCommonFunctionCall {
init {
CallerOchFunctionCallManager.setOchCommonFunctionCall(this)
}
override fun logout() {
M_LISTENERS.forEach {
it.value.logout()
}
}
}

View File

@@ -0,0 +1,6 @@
package com.mogo.och.common.module.manager.transform
interface OchTransformDispatch {
fun logout(){}
}

View File

@@ -23,6 +23,8 @@ import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
import com.mogo.och.common.module.manager.socket.lan.LedScreenManager
import com.mogo.och.common.module.manager.transform.OchTransform
import com.mogo.och.common.module.manager.transform.OchTransformDispatch
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.common.module.utils.NumberFormatUtil
import com.mogo.och.common.module.utils.OCHThreadPoolManager
@@ -67,6 +69,8 @@ object OrderModel {
// 定位监听
OchLocationManager.addGCJ02Listener(TAG, 5, mMapLocationListener)
OchTransform.addListener(TAG,ochTransform)
RxUtils.errCatch()
}
@@ -79,7 +83,19 @@ object OrderModel {
TicketModel.release()
OchLocationManager.removeGCJ02Listener(TAG)
OchTransform.removeListener(TAG)
}
private val ochTransform = object : OchTransformDispatch {
override fun logout() {
ThreadUtils.getIoPool().execute {
if(EventModel.haveDataWaitSyn()){
ToastUtils.showShort(ResourcesUtils.getString(R.string.shuttle_logout_error))
return@execute
}
LoginStatusManager.loginOut()
}
}
}

View File

@@ -0,0 +1,14 @@
package com.mogo.eagle.core.function.api.och
/**
* 定义给 Och 业务层调用的接口
*/
interface IOchCommonFunctionCall {
/**
* 退出登录
*/
fun logout()
}

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.call.och
import com.mogo.eagle.core.function.api.och.IOchCommonFunctionCall
import com.mogo.eagle.core.function.api.och.IOchFunctionCall
import com.mogo.eagle.core.function.api.och.IToolKitItemClickListener
import com.mogo.eagle.core.function.call.base.CallerBase
@@ -35,6 +36,11 @@ object CallerOchFunctionCallManager : CallerBase<IOchFunctionCall>() {
}
}
private var _ochCallFuncation:IOchCommonFunctionCall?=null
val ochCallFuncation:IOchCommonFunctionCall?
get() = _ochCallFuncation
/**
* 注册 工具箱 item点击事件监听 (默认样式item的点击事件监听自定义样式的item的点击交给view自己处理)
*/
@@ -54,4 +60,8 @@ object CallerOchFunctionCallManager : CallerBase<IOchFunctionCall>() {
fun setPlateNumber(plateNumber:String?){
this.plateNumber = plateNumber
}
fun setOchCommonFunctionCall(caller: IOchCommonFunctionCall){
this._ochCallFuncation = caller
}
}