rebase
This commit is contained in:
@@ -5,16 +5,17 @@ import com.mogo.chat.model.ChatServiceModel
|
||||
import com.mogo.chat.model.bean.AllUnit
|
||||
import com.mogo.chat.model.bean.LocationCarsWithRadius
|
||||
import com.mogo.chat.model.bean.toSns
|
||||
import com.mogo.chat.net.request
|
||||
import com.mogo.chat.util.UserInfoHelper
|
||||
import com.mogo.chat.util.log
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.utils.network.request
|
||||
|
||||
open class BaseController {
|
||||
|
||||
val chatServiceModel: ChatServiceModel = ChatServiceModel()
|
||||
|
||||
fun getUserInfo(onSuccess: (() -> Unit)? = null, onError: ((Exception) -> Unit)? = null) {
|
||||
if (!UserInfoHelper.userInfo.sn.isBlank()) {
|
||||
if (UserInfoHelper.userInfo.sn.isNotBlank()) {
|
||||
log(TAG, "userInfo getSn : ${UserInfoHelper.userInfo}")
|
||||
onSuccess?.invoke()
|
||||
return
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.chat.util.UserInfoHelper.userInfo
|
||||
import com.mogo.chat.util.log
|
||||
import com.mogo.chat.util.sp.getRoomId
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.mogo.chat.base
|
||||
|
||||
import com.mogo.chat.constant.HttpConstants
|
||||
|
||||
class BaseResponse<out T>(val code: Int, val msg: String, val result: T) {
|
||||
|
||||
fun isSuccess(baseUrl: String): Boolean {
|
||||
return when (baseUrl) {
|
||||
HttpConstants.getBaseUrl() -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.mogo.chat.exception
|
||||
|
||||
class ApiException : CommonException {
|
||||
|
||||
companion object {
|
||||
val NULL_REQUEST_DATA_API_EXCEPTION = ApiException(2, "request data is null")
|
||||
val ENTER_ROOM_API_EXCEPTION = ApiException(3, "roomId is null or already enter room")
|
||||
}
|
||||
|
||||
constructor(code: Int, msg: String) : super(code, msg)
|
||||
|
||||
fun getErrorMsg():String{
|
||||
return msg
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.mogo.chat.exception
|
||||
|
||||
class CallApiException : CommonException {
|
||||
|
||||
companion object {
|
||||
|
||||
val ENTER_ROOM_API_EXCEPTION = CallApiException(3, "roomId is null or already enter room")
|
||||
}
|
||||
|
||||
constructor(code: Int, msg: String) : super(code, msg)
|
||||
|
||||
fun getErrorMsg():String{
|
||||
return msg
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ open class CommonException :Exception{
|
||||
companion object{
|
||||
val NETWORK_EXCEPTION = CommonException(1, "network is error")
|
||||
val NULL_EXCEPTION = CommonException(1, "exception is null")
|
||||
val NULL_REQUEST_DATA_API_EXCEPTION = CommonException(1, "request data is null")
|
||||
}
|
||||
|
||||
protected var code: Int = 0
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mogo.chat.model
|
||||
|
||||
import com.mogo.chat.base.BaseRepository
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.constant.HttpConstants.Companion.getConfig
|
||||
import com.mogo.chat.model.bean.OnLineStatus
|
||||
import com.mogo.chat.model.bean.UserInfoBySns
|
||||
import com.mogo.chat.model.bean.UserInfoBySnsRequest
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
|
||||
|
||||
class ChatServiceModel : BaseRepository() {
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.mogo.chat.model
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.mogo.chat.base.BaseRepository
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.model.bean.FocusBlackListRequest
|
||||
import com.mogo.chat.model.bean.FocusData
|
||||
import com.mogo.chat.model.bean.FriendRequest
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
|
||||
class FocusModel : BaseRepository() {
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.mogo.chat.model
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.mogo.chat.base.BaseRepository
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.model.bean.FriendData
|
||||
import com.mogo.chat.model.bean.FriendOrSelfOnLine
|
||||
import com.mogo.chat.model.bean.FriendRequest
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
|
||||
class FriendModel : BaseRepository() {
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.mogo.chat.model.bean
|
||||
|
||||
fun OnLineStatus.onLine(): Boolean {
|
||||
return carOnLine == 1 && onLine == 1
|
||||
}
|
||||
|
||||
/**
|
||||
* carOnLine:ACC ON状态 1:在线 2:不在线
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.chat.model.control
|
||||
|
||||
import com.mogo.chat.R
|
||||
import com.mogo.chat.base.BaseController
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.callcenter.CallController.Companion.callController
|
||||
import com.mogo.chat.callcenter.CallTypeManager.Companion.callTypeManager
|
||||
import com.mogo.chat.callcenter.exchangeToCallType
|
||||
@@ -12,9 +11,8 @@ import com.mogo.chat.constant.CALL_TYPE_VOICE
|
||||
import com.mogo.chat.constant.PUSH_MSG_DENY_ENTER
|
||||
import com.mogo.chat.constant.PUSH_MSG_HANG_UP
|
||||
import com.mogo.chat.constant.TAG
|
||||
import com.mogo.chat.exception.ApiException.Companion.ENTER_ROOM_API_EXCEPTION
|
||||
import com.mogo.chat.exception.CallApiException.Companion.ENTER_ROOM_API_EXCEPTION
|
||||
import com.mogo.chat.model.bean.RoomInfo
|
||||
import com.mogo.chat.net.request
|
||||
import com.mogo.chat.util.CallTimer.Companion.callTimer
|
||||
import com.mogo.chat.util.MediaController
|
||||
import com.mogo.chat.util.UserInfoHelper
|
||||
@@ -23,6 +21,8 @@ import com.mogo.chat.util.log
|
||||
import com.mogo.chat.util.sp.saveRoomId
|
||||
import com.mogo.chat.util.trackCall
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.utils.network.request
|
||||
|
||||
|
||||
object ChatController : BaseController(), IGMEEventCallBack {
|
||||
|
||||
@@ -3,18 +3,18 @@ package com.mogo.chat.model.control
|
||||
import com.mogo.chat.R
|
||||
import com.mogo.chat.aspect.DebugLog
|
||||
import com.mogo.chat.base.BaseController
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.callcenter.CallTypeManager.Companion.callTypeManager
|
||||
import com.mogo.chat.callcenter.IMType
|
||||
import com.mogo.chat.callcenter.canMatchTimeout
|
||||
import com.mogo.chat.constant.TAG
|
||||
import com.mogo.chat.model.bean.MatchRequestParam
|
||||
import com.mogo.chat.net.request
|
||||
import com.mogo.chat.net.taskDelayAsync
|
||||
import com.mogo.chat.provider.ServiceApi
|
||||
import com.mogo.chat.util.*
|
||||
import com.mogo.chat.util.audio.AudioFocusUtil
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.utils.network.request
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package com.mogo.chat.model.control
|
||||
|
||||
import com.mogo.chat.base.BaseController
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.common.gme.IGMEEventCallBack
|
||||
import com.mogo.chat.constant.CALL_TYPE_VEHICLE_TEAM
|
||||
import com.mogo.chat.constant.PUSH_MSG_DENY_ENTER
|
||||
import com.mogo.chat.constant.PUSH_MSG_HANG_UP
|
||||
import com.mogo.chat.constant.TAG
|
||||
import com.mogo.chat.model.bean.CallRequestParam
|
||||
import com.mogo.chat.net.request
|
||||
import com.mogo.chat.provider.ServiceApi
|
||||
import com.mogo.chat.util.UserInfoHelper
|
||||
import com.mogo.chat.util.log
|
||||
import com.mogo.chat.util.sp.getRoomId
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.network.Utils
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.utils.network.request
|
||||
|
||||
object VehicleTeamController : BaseController(), IGMEEventCallBack {
|
||||
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
package com.mogo.chat.net
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.chat.exception.ApiException
|
||||
import com.mogo.chat.exception.ApiException.Companion.NULL_REQUEST_DATA_API_EXCEPTION
|
||||
import com.mogo.chat.exception.CommonException.Companion.NETWORK_EXCEPTION
|
||||
import com.mogo.chat.exception.CommonException.Companion.NULL_EXCEPTION
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import kotlinx.coroutines.*
|
||||
import java.net.SocketTimeoutException
|
||||
import java.net.UnknownHostException
|
||||
import java.util.concurrent.TimeoutException
|
||||
|
||||
class Request<T> {
|
||||
private lateinit var loader: suspend () -> T
|
||||
|
||||
private var start: (() -> Unit)? = null
|
||||
|
||||
private var onSuccess: ((T) -> Unit)? = null
|
||||
|
||||
private var onError: ((java.lang.Exception) -> Unit)? = null
|
||||
|
||||
private var onComplete: (() -> Unit)? = null
|
||||
|
||||
private var addLifecycle: LifecycleOwner? = null
|
||||
|
||||
|
||||
infix fun loader(loader: suspend () -> T) {
|
||||
this.loader = loader
|
||||
}
|
||||
|
||||
infix fun start(start: (() -> Unit)?) {
|
||||
this.start = start
|
||||
}
|
||||
|
||||
infix fun onSuccess(onSuccess: ((T) -> Unit)?) {
|
||||
this.onSuccess = onSuccess
|
||||
}
|
||||
|
||||
infix fun onError(onError: ((java.lang.Exception) -> Unit)?) {
|
||||
this.onError = onError
|
||||
}
|
||||
|
||||
infix fun onComplete(onComplete: (() -> Unit)?) {
|
||||
this.onComplete = onComplete
|
||||
}
|
||||
|
||||
infix fun addLifecycle(addLifecycle: LifecycleOwner?) {
|
||||
this.addLifecycle = addLifecycle
|
||||
}
|
||||
|
||||
fun request() {
|
||||
|
||||
GlobalScope.launch(context = Dispatchers.Main) {
|
||||
|
||||
start?.invoke()
|
||||
try {
|
||||
val deferred = GlobalScope.async(Dispatchers.IO, start = CoroutineStart.LAZY) {
|
||||
loader()
|
||||
}
|
||||
val result = deferred.await()
|
||||
if (result != null && result is BaseResponse<*>) {
|
||||
if (result.code == 0) {
|
||||
onSuccess?.invoke(result)
|
||||
} else {
|
||||
throw ApiException(result.code, result.msg)
|
||||
}
|
||||
} else {
|
||||
throw NULL_REQUEST_DATA_API_EXCEPTION
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
//数据打点
|
||||
if (e == null) {
|
||||
onError?.invoke(NULL_EXCEPTION)
|
||||
}
|
||||
when (e) {
|
||||
is UnknownHostException -> onError?.invoke(NETWORK_EXCEPTION)
|
||||
is TimeoutException -> onError?.invoke(NETWORK_EXCEPTION)
|
||||
is SocketTimeoutException -> onError?.invoke(NETWORK_EXCEPTION)
|
||||
else -> onError?.invoke(java.lang.Exception(e.message))
|
||||
}
|
||||
} finally {
|
||||
onComplete?.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <T> request(buildRequest: Request<T>.() -> Unit) {
|
||||
Request<T>().apply(buildRequest).request()
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.chat.net
|
||||
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.model.bean.*
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import retrofit2.http.*
|
||||
|
||||
interface HttpApi {
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.chat.service
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.mogo.chat.base.BaseController
|
||||
import com.mogo.chat.base.BaseResponse
|
||||
import com.mogo.chat.callcenter.CallTypeManager.Companion.callTypeManager
|
||||
import com.mogo.chat.callcenter.exchangeToCallType
|
||||
import com.mogo.chat.callcenter.isCalling
|
||||
@@ -12,11 +11,9 @@ import com.mogo.chat.constant.*
|
||||
import com.mogo.chat.model.bean.FocusStatus
|
||||
import com.mogo.chat.model.bean.OnLineStatus
|
||||
import com.mogo.chat.model.bean.UserInfoBySns
|
||||
import com.mogo.chat.model.bean.onLine
|
||||
import com.mogo.chat.model.control.ChatController
|
||||
import com.mogo.chat.model.control.MatchController
|
||||
import com.mogo.chat.model.control.VehicleTeamController
|
||||
import com.mogo.chat.net.request
|
||||
import com.mogo.chat.service.InvokeDataProxy.Companion.covertMapToSns
|
||||
import com.mogo.chat.util.UserInfoHelper.currentCallType
|
||||
import com.mogo.chat.util.UserInfoHelper.tmpSenderInfo
|
||||
@@ -24,13 +21,15 @@ import com.mogo.chat.util.log
|
||||
import com.mogo.chat.util.sp.setCarOnLineStatus
|
||||
import com.mogo.chat.util.trackHangUp
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.utils.network.request
|
||||
|
||||
object ChatServiceHandler : BaseController() {
|
||||
|
||||
fun call(
|
||||
snReceiver: String,
|
||||
onSuccess: (() -> Unit),
|
||||
onError: ((Exception) -> Unit)
|
||||
snReceiver: String,
|
||||
onSuccess: (() -> Unit),
|
||||
onError: ((Exception) -> Unit)
|
||||
) {
|
||||
queryUserInfo(snReceiver, {
|
||||
val map = Gson().fromJson<Map<String, String>>(it, Map::class.java)
|
||||
@@ -47,9 +46,9 @@ object ChatServiceHandler : BaseController() {
|
||||
}
|
||||
|
||||
private fun realCall(
|
||||
snReceiver: String,
|
||||
onSuccess: (() -> Unit),
|
||||
onError: ((Exception) -> Unit)
|
||||
snReceiver: String,
|
||||
onSuccess: (() -> Unit),
|
||||
onError: ((Exception) -> Unit)
|
||||
) {
|
||||
ChatController.call(snReceiver, 0, {
|
||||
onSuccess.invoke()
|
||||
@@ -63,7 +62,12 @@ object ChatServiceHandler : BaseController() {
|
||||
realHangUp(onSuccess, onError, roomId)
|
||||
}
|
||||
|
||||
fun refuseCall(sn: String?, onSuccess: () -> Unit, onError: (Exception) -> Unit, roomId: Int = -1) {
|
||||
fun refuseCall(
|
||||
sn: String?,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (Exception) -> Unit,
|
||||
roomId: Int = -1
|
||||
) {
|
||||
var hangUpSn: String? = sn
|
||||
if (hangUpSn.isNullOrBlank()) {
|
||||
if (tmpSenderInfo.sn.isBlank()) {
|
||||
@@ -80,53 +84,92 @@ object ChatServiceHandler : BaseController() {
|
||||
currentCallType == CALL_TYPE_VEHICLE_TEAM -> {
|
||||
trackHangUp(CALL_TYPE_VEHICLE_TEAM, "2")
|
||||
log(TAG, "hangUp VehicleTeam")
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(MoGoAiCloudClientConfig.getInstance().sn, PUSH_MSG_HANG_UP, CALL_TYPE_VEHICLE_TEAM, onSuccess, onError)
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(
|
||||
MoGoAiCloudClientConfig.getInstance().sn,
|
||||
PUSH_MSG_HANG_UP,
|
||||
CALL_TYPE_VEHICLE_TEAM,
|
||||
onSuccess,
|
||||
onError
|
||||
)
|
||||
}
|
||||
GMEApi.isRoomEntered() || callTypeManager.callStatus.isCalling() -> {
|
||||
trackHangUp(callTypeManager.callStatus.exchangeToCallType(), "2")
|
||||
log(TAG, "hangUp Call")
|
||||
ChatController.requestConnectStatus(tmpSenderInfo.sn, PUSH_MSG_HANG_UP, onSuccess, onError, roomId)
|
||||
ChatController.requestConnectStatus(
|
||||
tmpSenderInfo.sn,
|
||||
PUSH_MSG_HANG_UP,
|
||||
onSuccess,
|
||||
onError,
|
||||
roomId
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
log(TAG, "realHangUp " +
|
||||
"currentCallStatus : ${callTypeManager.callStatus} + " +
|
||||
"currentCallType : $currentCallType")
|
||||
log(
|
||||
TAG, "realHangUp " +
|
||||
"currentCallStatus : ${callTypeManager.callStatus} + " +
|
||||
"currentCallType : $currentCallType"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun realRefuse(sn: String, onSuccess: () -> Unit, onError: (Exception) -> Unit, roomId: Int = -1) {
|
||||
private fun realRefuse(
|
||||
sn: String,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (Exception) -> Unit,
|
||||
roomId: Int = -1
|
||||
) {
|
||||
log(TAG, "realRefuse currentCallType : $currentCallType ")
|
||||
when {
|
||||
currentCallType == CALL_TYPE_VEHICLE_TEAM -> {
|
||||
log(TAG, "refuse VehicleTeam")
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(sn, PUSH_MSG_DENY_ENTER, CALL_TYPE_VEHICLE_TEAM, onSuccess, onError)
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(
|
||||
sn,
|
||||
PUSH_MSG_DENY_ENTER,
|
||||
CALL_TYPE_VEHICLE_TEAM,
|
||||
onSuccess,
|
||||
onError
|
||||
)
|
||||
}
|
||||
callTypeManager.callStatus.isReadyCalling() -> {
|
||||
log(TAG, "refuse call")
|
||||
ChatController.requestConnectStatus(sn, PUSH_MSG_DENY_ENTER, onSuccess, onError, roomId)
|
||||
ChatController.requestConnectStatus(
|
||||
sn,
|
||||
PUSH_MSG_DENY_ENTER,
|
||||
onSuccess,
|
||||
onError,
|
||||
roomId
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
log(TAG, "realRefuse " +
|
||||
"currentCallStatus : ${callTypeManager.callStatus} + " +
|
||||
"currentCallType : $currentCallType")
|
||||
log(
|
||||
TAG, "realRefuse " +
|
||||
"currentCallStatus : ${callTypeManager.callStatus} + " +
|
||||
"currentCallType : $currentCallType"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun answer(
|
||||
sn: String,
|
||||
roomId: Int,
|
||||
onSuccess: (() -> Unit)? = null,
|
||||
onError: ((Exception) -> Unit)? = null
|
||||
sn: String,
|
||||
roomId: Int,
|
||||
onSuccess: (() -> Unit)? = null,
|
||||
onError: ((Exception) -> Unit)? = null
|
||||
) {
|
||||
log(TAG, "answer currentCallType ==== $currentCallType")
|
||||
getUserInfo({
|
||||
when (currentCallType) {
|
||||
CALL_TYPE_VEHICLE_TEAM -> {
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(sn, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VEHICLE_TEAM, {
|
||||
onSuccess?.invoke()
|
||||
}, onError)
|
||||
VehicleTeamController.requestVehicleTeamConnectStatus(
|
||||
sn,
|
||||
PUSH_MSG_AGREE_ENTER,
|
||||
CALL_TYPE_VEHICLE_TEAM,
|
||||
{
|
||||
onSuccess?.invoke()
|
||||
},
|
||||
onError
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
ChatController.requestConnectStatus(sn, PUSH_MSG_AGREE_ENTER, {
|
||||
@@ -141,10 +184,10 @@ object ChatServiceHandler : BaseController() {
|
||||
}
|
||||
|
||||
fun startMatch(
|
||||
flag: String,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (Exception) -> Unit,
|
||||
timeOut: () -> Unit
|
||||
flag: String,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (Exception) -> Unit,
|
||||
timeOut: () -> Unit
|
||||
) {
|
||||
getUserInfo({
|
||||
MatchController.startMatch(flag, onSuccess, onError, timeOut)
|
||||
@@ -157,7 +200,11 @@ object ChatServiceHandler : BaseController() {
|
||||
MatchController.cancelMatch(onSuccess)
|
||||
}
|
||||
|
||||
fun inviteJoinVehicleTeam(invitedSn: String, onSuccess: () -> Unit, onError: (Exception) -> Unit) {
|
||||
fun inviteJoinVehicleTeam(
|
||||
invitedSn: String,
|
||||
onSuccess: () -> Unit,
|
||||
onError: (Exception) -> Unit
|
||||
) {
|
||||
VehicleTeamController.inviteJoinVehicleTeam(invitedSn, onSuccess, onError)
|
||||
}
|
||||
|
||||
@@ -212,7 +259,7 @@ object ChatServiceHandler : BaseController() {
|
||||
onSuccess {
|
||||
val onLineStatus = it.result
|
||||
log(TAG, "onLineStatus : $onLineStatus")
|
||||
onSuccess.invoke(onLineStatus.onLine())
|
||||
onSuccess.invoke(onLineStatus.carOnLine == 1 && onLineStatus.onLine == 1)
|
||||
}
|
||||
onError {
|
||||
onError.invoke(it)
|
||||
@@ -221,9 +268,9 @@ object ChatServiceHandler : BaseController() {
|
||||
}
|
||||
|
||||
fun queryUserInfo(
|
||||
sn: String,
|
||||
onSuccess: (userInfo: String) -> Unit,
|
||||
onError: (Exception) -> Unit
|
||||
sn: String,
|
||||
onSuccess: (userInfo: String) -> Unit,
|
||||
onError: (Exception) -> Unit
|
||||
) {
|
||||
request<BaseResponse<UserInfoBySns>> {
|
||||
loader {
|
||||
|
||||
Reference in New Issue
Block a user