Commit 6ca663e8 by 霍志良

feat:导医开关配置接口对接

parent 211e8dd3
package com.yidianling.consultant.bean;
public class HomeModuleTabEvent {
private int tabIndex;
public HomeModuleTabEvent(int index) {
tabIndex = index;
}
public int getTabIndex() {
return tabIndex;
}
public void setTabIndex(int tabIndex) {
this.tabIndex = tabIndex;
}
}
......@@ -67,10 +67,15 @@ interface SearchApi {
/*
* location字段说明(sign1存储页面位置,1:首页导医入口进入2:M站入口进入3:问答列表页进入4:我的入口进入
* 5:情绪疏导在线咨询入口进入6:咨询列表页导医入口进入7:实用心理课入口进入8:实用心理课课程列表页进入9:测评解读页进入
* 10:搜索页面进入11:首页咨询列表进入12:厌学的真相在线咨询入口,0是小壹意向客户传0)*/
* 10:搜索页面进入11:首页咨询列表进入12:厌学的真相在线咨询入口,0是小壹意向客户传0)
*
* ffrom_2 亲子教育添加字段
*naviType = "1";导医配置开关,返100跳转咨询tab,如果返其他则维持原有逻辑。
* */
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
@GET("consult/assistant/chat-distribute")
fun getConsultAssistantUidRequest(@Query("location")location: Int,@Query("ffrom_2")ffrom:String?): Observable<BaseAPIResponse<Long>>
fun getConsultAssistantUidRequest(@Query("location")location: Int,@Query("ffrom_2")ffrom:String?,@Query("naviType")naviType:String="1"): Observable<BaseAPIResponse<Long>>
//获取咨询助理uid
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
......
......@@ -11,10 +11,12 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ConsultAssistantCenterActivity
import com.yidianling.consultant.bean.HomeModuleTabEvent
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.dialog.ConsultAssistantDialog
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
......@@ -314,10 +316,15 @@ class ConsultAssistantDialogUtils private constructor() {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
if (it.code == "200" && it.data != 0.toLong() && null != activity) {
ConsultantIn.startP2PSession(activity as AppCompatActivity, it.data.toString())
} else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
if (it.data==100L){
//跳转咨询tab栏目
EventBus.getDefault().post(HomeModuleTabEvent(2))
}else{
if (it.code == "200" && it.data != 0.toLong() && null != activity) {
ConsultantIn.startP2PSession(activity as AppCompatActivity, it.data.toString())
} else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
}, object : ThrowableConsumer() {
......
......@@ -12,9 +12,11 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ConsultAssistantCenterActivity
import com.yidianling.consultant.bean.HomeModuleTabEvent
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
......@@ -36,13 +38,18 @@ class ConsultAssistantEntryUtils {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
if (it.code == "200" && it.data != 0.toLong() && null != activity) {
ConsultantIn.startP2PSession(
activity as AppCompatActivity,
it.data.toString()
)
} else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
if (it.data==100L){
//跳转咨询tab栏目
EventBus.getDefault().post(HomeModuleTabEvent(2))
}else{
if (it.code == "200" && it.data != 0.toLong() && null != activity) {
ConsultantIn.startP2PSession(
activity as AppCompatActivity,
it.data.toString()
)
} else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment