Merge branch 'dev_arch_opt_3.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0

This commit is contained in:
yangyakun
2023-01-29 16:28:47 +08:00
147 changed files with 3118 additions and 3193 deletions

View File

@@ -15,7 +15,7 @@ import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_DEFAULT
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VEHICLE_TEAM
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
import com.mogo.eagle.core.function.api.chat.biz.IMType.*
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.chat.facade.analytics.ChatAnalyticsFacade
import com.mogo.eagle.core.function.chat.facade.audio.AudioFocusFacade
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
@@ -581,7 +581,7 @@ object MoGoChatFacade: IMoGoChatFacade {
}
//告之服务器给发送方下发接收通话消息
try {
val location = CallerMapLocationListenerManager.getCurrentLocation()
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
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
@@ -812,7 +812,7 @@ object MoGoChatFacade: IMoGoChatFacade {
}
val response = serverApi.inviteJoinVehicleTeam(CallRequestParam().also {
val user = mySelf.get()
val location = CallerMapLocationListenerManager.getCurrentLocation()
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
it.snSender = mySn
it.snReceiver = sn
it.nickName = user.name
@@ -958,7 +958,7 @@ object MoGoChatFacade: IMoGoChatFacade {
}
//告之服务器给发送方下发接收通话消息
try {
val location = CallerMapLocationListenerManager.getCurrentLocation()
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
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

@@ -3,13 +3,12 @@ package com.mogo.eagle.core.function.chat.facade.net
import com.google.gson.Gson
import com.google.gson.JsonObject
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.HostConst
import com.mogo.eagle.core.data.BaseResponse
import com.mogo.eagle.core.data.chat.UserInfo
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
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.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.chat.facade.net.bean.*
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
@@ -33,7 +32,7 @@ internal class ChatServiceModel {
val sns = arrayListOf(sn)
val requestData = SnArrayRequestBody().also { it.sns = sns }
return apiCall {
getNetWorkApi(getConfig())?.queryUserInfoBySnS(requestData)
getNetWorkApi()?.queryUserInfoBySnS(requestData)
?: throw IllegalStateException("apis is null.")
}.let { itx ->
if (itx.code != 0 && itx.code != 200) {
@@ -70,7 +69,7 @@ internal class ChatServiceModel {
val map = hashMapOf<String, String>()
val sn = MoGoAiCloudClientConfig.getInstance().sn
val location = CallerMapLocationListenerManager.getCurrentLocation()
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
if (location != null) {
params.lon = location.longitude
params.lat = location.latitude
@@ -104,7 +103,7 @@ internal class ChatServiceModel {
suspend fun requestRoomInfo(param: CallRequestParam): BaseResponse<RoomInfo> {
val map = hashMapOf<String, String>()
val location = CallerMapLocationListenerManager.getCurrentLocation()
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
if (location != null) {
param.lat = location.latitude
param.lon = location.longitude
@@ -120,7 +119,7 @@ internal class ChatServiceModel {
return call.invoke()
}
private fun getNetWorkApi(baseUrl: String = ChatHttp.getBaseUrl()): HttpApi? {
private fun getNetWorkApi(baseUrl: String = HostConst.getEagleHost()): HttpApi? {
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl).create(HttpApi::class.java)
}
}
@@ -128,7 +127,7 @@ internal class ChatServiceModel {
internal interface HttpApi {
@FormUrlEncoded
@POST("/yycp-chat-service/car/voiceRoom/no/operate/v1")
@POST("eagle-eye-dns/yycp-chat-service/car/voiceRoom/no/operate/v1")
suspend fun requestConnectStatus(
@Query("sn") sn: String,
@FieldMap connectStatus: Map<String, String>
@@ -136,24 +135,24 @@ internal interface HttpApi {
//邀请加入车队
@FormUrlEncoded
@POST("/yycp-chat-service/car/chat/no/inviteJoinTeam/v1")
@POST("eagle-eye-dns/yycp-chat-service/car/chat/no/inviteJoinTeam/v1")
suspend fun inviteJoinVehicleTeam(@FieldMap inviteVehicleTeam: Map<String, String>): BaseResponse<Any>
//车队状态同步
@FormUrlEncoded
@POST("/yycp-chat-service/car/chat/no/operateTeamRoom/v1")
@POST("eagle-eye-dns/yycp-chat-service/car/chat/no/operateTeamRoom/v1")
suspend fun requestVehicleTeamConnectStatus(@FieldMap connectStatus: Map<String, String>): BaseResponse<Any>
//查询用户是否在线
@FormUrlEncoded
@POST("/yycp-chat-service/car/queryOnLineBySn/v1")
@POST("eagle-eye-dns/yycp-chat-service/car/queryOnLineBySn/v1")
suspend fun isOnLine(@FieldMap onLine: Map<String, String>): BaseResponse<OnLineStatus>
@POST("/yycp-realtimeLocations/realTimeLocationServer/queryRsAncCarAndUserInfoBySns")
@POST("eagle-eye-dns/yycp-realtimeLocations/realTimeLocationServer/queryRsAncCarAndUserInfoBySns")
suspend fun queryUserInfoBySnS(@Body body: SnArrayRequestBody): BaseResponse<JsonObject>
//语音房间信息原路径dataService
@FormUrlEncoded
@POST("/yycp-chat-service/car/sender/no/createRoom/v1")
@POST("eagle-eye-dns/yycp-chat-service/car/sender/no/createRoom/v1")
suspend fun requestRoomInfo(@FieldMap roomInfo: Map<String, String>): BaseResponse<RoomInfo>
}