[Update]Map按照新架构重构

This commit is contained in:
chenfufeng
2022-03-16 17:50:57 +08:00
parent 95c7251b54
commit 989f59678d
111 changed files with 5552 additions and 524 deletions

View File

@@ -38,6 +38,7 @@ import com.mogo.eagle.core.function.chat.facade.utils.log
import com.mogo.eagle.core.function.chat.facade.voice.VoiceControlFacade
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.map.MogoLocationClient
import kotlinx.coroutines.*
import kotlinx.coroutines.android.asCoroutineDispatcher
import kotlinx.coroutines.channels.Channel
@@ -580,7 +581,7 @@ object MoGoChatFacade: IMoGoChatFacade {
}
//告之服务器给发送方下发接收通话消息
try {
val location = BridgeApi.locationClient()?.lastKnowLocation
val location = MogoLocationClient.getInstance(context())?.lastKnowLocation
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VOICE.type).also {
it.nickName = mySelf.get().name
it.headImgUrl = mySelf.get().icon
@@ -811,7 +812,7 @@ object MoGoChatFacade: IMoGoChatFacade {
}
val response = serverApi.inviteJoinVehicleTeam(CallRequestParam().also {
val user = mySelf.get()
val location = BridgeApi.locationClient()?.lastKnowLocation
val location = MogoLocationClient.getInstance(context())?.lastKnowLocation
it.snSender = mySn
it.snReceiver = sn
it.nickName = user.name
@@ -957,7 +958,7 @@ object MoGoChatFacade: IMoGoChatFacade {
}
//告之服务器给发送方下发接收通话消息
try {
val location = BridgeApi.locationClient()?.lastKnowLocation
val location = MogoLocationClient.getInstance(context())?.lastKnowLocation
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VEHICLE_TEAM.type).also {
it.nickName = mySelf.get().name
it.headImgUrl = mySelf.get().icon

View File

@@ -21,8 +21,6 @@ internal object BridgeApi {
internal fun context(): Context = contextHolder?.get() ?: Utils.getApp()
internal fun locationClient() = apis?.mapServiceApi?.getSingletonLocationClient(context())
internal fun intentManager() = apis?.intentManagerApi
internal fun statusManager() = apis?.statusManagerApi

View File

@@ -5,6 +5,7 @@ import com.google.gson.Gson
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.AbsMogoApplication
import com.mogo.eagle.core.data.BaseResponse
import com.mogo.eagle.core.data.chat.UserInfo
import com.mogo.eagle.core.data.constants.MogoServicePaths
@@ -15,6 +16,7 @@ import com.mogo.eagle.core.function.chat.facade.consts.ChatHttp
import com.mogo.eagle.core.function.chat.facade.consts.ChatHttp.Companion.getConfig
import com.mogo.eagle.core.function.chat.facade.net.bean.*
import com.mogo.eagle.core.function.chat.facade.utils.log
import com.mogo.map.MogoLocationClient
import com.mogo.service.IMogoServiceApis
import retrofit2.http.*
import java.lang.IllegalStateException
@@ -72,7 +74,7 @@ internal class ChatServiceModel {
suspend fun requestConnectStatus(params: ConnectStatusParam): BaseResponse<Any> {
val map = hashMapOf<String, String>()
val sn = MoGoAiCloudClientConfig.getInstance().sn
val location = BridgeApi.locationClient()?.lastKnowLocation
val location = MogoLocationClient.getInstance(AbsMogoApplication.getApp())?.lastKnowLocation
if (location != null) {
params.lon = location.longitude
params.lat = location.latitude
@@ -103,7 +105,7 @@ internal class ChatServiceModel {
suspend fun requestRoomInfo(param: CallRequestParam): BaseResponse<RoomInfo> {
val map = hashMapOf<String, String>()
val location = BridgeApi.locationClient()?.lastKnowLocation
val location = MogoLocationClient.getInstance(AbsMogoApplication.getApp())?.lastKnowLocation
if (location != null) {
param.lat = location.latitude
param.lon = location.longitude