[Chat]车聊聊架构升级
This commit is contained in:
@@ -7,7 +7,6 @@ plugins {
|
||||
}
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
@@ -45,16 +44,19 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_api
|
||||
implementation rootProject.ext.dependencies.mogoserviceapi
|
||||
} else {
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-function-api')
|
||||
implementation project(':services:mogo-service-api')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.mogo.eagle.core.function.call.chat
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.function.api.chat.IMoGoChatProvider
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatParams
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
|
||||
object CallerChatManager: CallerBase() {
|
||||
|
||||
private val provider by lazy {
|
||||
getApiInstance(IMoGoChatProvider::class.java, ChatConsts.CHAT_PROVIDER_PATH)?.chat()
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
fun call(ctx: Context , sn: String) {
|
||||
val facade = provider ?: return
|
||||
facade
|
||||
.call(ChatParams(sn))
|
||||
.onEach {
|
||||
Log.e(ChatConsts.TAG, "call state: $it")
|
||||
}
|
||||
.launchIn(ctx.lifeCycleScope)
|
||||
}
|
||||
|
||||
fun chat() = provider
|
||||
}
|
||||
Reference in New Issue
Block a user