|
|
@@ -3,9 +3,15 @@ package com.atmob.keyboard_android.util.bridge
|
|
|
import com.atmob.keyboard_android.constant.PluginConfig
|
|
|
import com.atmob.keyboard_android.enums.FlutterMethod
|
|
|
import com.atmob.keyboard_android.util.bridge.model.base.EmptyResp
|
|
|
+import com.atmob.keyboard_android.util.bridge.model.req.SuperReplyReq
|
|
|
+import com.atmob.keyboard_android.util.bridge.model.req.SuperSpeakReq
|
|
|
import com.atmob.keyboard_android.util.bridge.model.resp.CharacterListResp
|
|
|
import com.atmob.keyboard_android.util.bridge.model.resp.CurrentKeyboardIdResp
|
|
|
import com.atmob.keyboard_android.util.bridge.model.resp.KeyboardListResp
|
|
|
+import com.atmob.keyboard_android.util.bridge.model.resp.PrologueListResp
|
|
|
+import com.atmob.keyboard_android.util.bridge.model.resp.PrologueResp
|
|
|
+import com.atmob.keyboard_android.util.bridge.model.resp.SuperReplyResp
|
|
|
+import com.atmob.keyboard_android.util.bridge.model.resp.SuperSpeakResp
|
|
|
import com.atmob.keyboard_android.util.bridge.util.FlutterMethodCaller
|
|
|
import com.atmob.keyboard_android.util.bridge.util.NativeMethodRegistry
|
|
|
import io.flutter.embedding.engine.FlutterEngineCache
|
|
|
@@ -102,4 +108,68 @@ object FlutterBridgeManager : IBridgeApi {
|
|
|
onFail = onFail
|
|
|
)
|
|
|
}
|
|
|
+
|
|
|
+ override fun getPrologueList(
|
|
|
+ onSuccess: (PrologueListResp) -> Unit,
|
|
|
+ onFail: (String) -> Unit
|
|
|
+ ) {
|
|
|
+ mFlutterMethodCaller.callMethod<PrologueListResp>(
|
|
|
+ FlutterMethod.GET_PROLOGUE_LIST.methodName,
|
|
|
+ modelClazz = PrologueListResp::class.java,
|
|
|
+ onSuccess = onSuccess,
|
|
|
+ onFail = onFail
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun superReply(
|
|
|
+ req: SuperReplyReq,
|
|
|
+ onSuccess: (SuperReplyResp) -> Unit,
|
|
|
+ onFail: (String) -> Unit
|
|
|
+ ) {
|
|
|
+ mFlutterMethodCaller.callMethod<SuperReplyResp>(
|
|
|
+ FlutterMethod.SUPER_REPLY.methodName,
|
|
|
+ args = mapOf(
|
|
|
+ "keyboardId" to req.keyboardId,
|
|
|
+ "characterId" to req.characterId,
|
|
|
+ "content" to req.content,
|
|
|
+ ),
|
|
|
+ modelClazz = SuperReplyResp::class.java,
|
|
|
+ onSuccess = onSuccess,
|
|
|
+ onFail = onFail
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun superSpeak(
|
|
|
+ req: SuperSpeakReq,
|
|
|
+ onSuccess: (SuperSpeakResp) -> Unit,
|
|
|
+ onFail: (String) -> Unit
|
|
|
+ ) {
|
|
|
+ mFlutterMethodCaller.callMethod<SuperSpeakResp>(
|
|
|
+ FlutterMethod.SUPER_SPEAK.methodName,
|
|
|
+ args = mapOf(
|
|
|
+ "keyboardId" to req.keyboardId,
|
|
|
+ "characterId" to req.characterId,
|
|
|
+ "content" to req.content,
|
|
|
+ ),
|
|
|
+ modelClazz = SuperSpeakResp::class.java,
|
|
|
+ onSuccess = onSuccess,
|
|
|
+ onFail = onFail
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun prologue(
|
|
|
+ name: String,
|
|
|
+ onSuccess: (PrologueResp) -> Unit,
|
|
|
+ onFail: (String) -> Unit
|
|
|
+ ) {
|
|
|
+ mFlutterMethodCaller.callMethod<PrologueResp>(
|
|
|
+ FlutterMethod.PROLOGUE.methodName,
|
|
|
+ args = mapOf(
|
|
|
+ "name" to name,
|
|
|
+ ),
|
|
|
+ modelClazz = PrologueResp::class.java,
|
|
|
+ onSuccess = onSuccess,
|
|
|
+ onFail = onFail
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|