|
|
@@ -1,14 +1,11 @@
|
|
|
package com.nova.brain.glass.helper
|
|
|
|
|
|
-import android.content.Context
|
|
|
-import android.widget.Toast
|
|
|
+import com.nova.brain.glass.MyApplication
|
|
|
import com.nova.brain.glass.helper.IntentRecognizeHelper.dispose
|
|
|
import com.nova.brain.glass.helper.IntentRecognizeHelper.recognize
|
|
|
import com.nova.brain.glass.model.RecognizeAction
|
|
|
import com.nova.brain.glass.model.data.RecognizeData
|
|
|
-import com.nova.brain.glass.repository.HeaderInterceptor
|
|
|
import com.nova.brain.glass.repository.Service
|
|
|
-import com.rokid.utils.ContextUtil.getApplicationContext
|
|
|
import com.xuqm.base.di.manager.HttpManager
|
|
|
import com.xuqm.base.extensions.showMessage
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
|
|
@@ -32,8 +29,6 @@ object IntentRecognizeHelper {
|
|
|
private var questionIndex = 0
|
|
|
private var disposable: Disposable? = null
|
|
|
|
|
|
-// private val baseUrl: String = "https://22v1322u01.vicp.fun"
|
|
|
- private val baseUrl: String = "http://192.168.6.20:12119"
|
|
|
|
|
|
/**
|
|
|
* @param context 用于显示 Toast
|
|
|
@@ -53,10 +48,8 @@ object IntentRecognizeHelper {
|
|
|
disposable?.dispose()
|
|
|
val question = text ?: nextQuestion()
|
|
|
disposable = HttpManager.getApi(
|
|
|
- HttpManager.getAppComponent(
|
|
|
- baseUrl,
|
|
|
- HeaderInterceptor(getApplicationContext())
|
|
|
- ), Service::class.java)
|
|
|
+ MyApplication.appComponent1, Service::class.java
|
|
|
+ )
|
|
|
.recognize(RecognizeData(text = question, scence = scence))
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|