修复多次调用检查直播间接口问题

This commit is contained in:
18401019693 2022-11-28 14:42:24 +08:00
parent e6766dc5eb
commit e405965298
9 changed files with 17 additions and 67 deletions

View File

@ -50,7 +50,6 @@ import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.main.R;
import com.yunbao.main.event.RegSuccessEvent;
import com.yunbao.main.http.MainHttpConsts;
@ -503,13 +502,9 @@ public class RegisterActivity extends AbsActivity {
if (liveBean == null) {
return;
}
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
RouteUtil.forwardLiveAudienceActivity(liveBean, 0, 0, 0);
NoviceInstructorManager.get(mContext).setFrist(false);
}
});
} else {
MainActivity.forward(RegisterActivity.this, false);
}

View File

@ -18,20 +18,18 @@ import androidx.fragment.app.FragmentTransaction;
import com.alibaba.fastjson.JSON;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.event.CloseEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.SearchHistoryRecordManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.utils.WordsTypeUtil;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.main.R;
import com.yunbao.main.event.JumpUserHomeEvent;
import com.yunbao.main.fragment.SearchRecommendFragment;
import com.yunbao.main.fragment.SearchResultsFragment;
import com.yunbao.common.utils.WordsTypeUtil;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@ -174,13 +172,8 @@ public class SearchActivity extends AbsActivity {
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
RouteUtil.forwardLiveAudienceActivity(liveBean, 0, 0, 0);
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
}
});
} else {
//跳转到个人资料
if (imm != null && mEditText != null) {

View File

@ -152,12 +152,7 @@ public class WeekWebViewActivity extends AbsActivity {
if (liveBean == null) {
return;
}
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
}
});
RouteUtil.forwardLiveAudienceActivity(liveBean, 0, 0, 0);
} else {
RouteUtil.forwardUserHome(mContext, live_id, 0);
}

View File

@ -199,12 +199,7 @@ public class SearchAdapter extends RefreshAdapter<SearchUserBean> {
return;
}
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
}
});
RouteUtil.forwardLiveAudienceActivity(liveBean, 0, 0, 0);
} else {
RouteUtil.forwardUserHome(mContext, live_id, 0);
}

View File

@ -148,13 +148,9 @@ public class OneLoginDialog extends AbsDialogFragment {
if (liveBean == null) {
return;
}
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
RouteUtil.forwardLiveAudienceActivity(liveBean, 0, 0, 0);
NoviceInstructorManager.get(mContext).setFrist(false);
}
});
} else {
MainActivity.forward(mContext, false);
}

View File

@ -148,12 +148,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
}
});
RouteUtil.forwardLiveAudienceActivity(liveBean, 0, 0, 0);
} else {
MainActivity.forward(mContext, false);
}
@ -364,12 +359,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
}
});
RouteUtil.forwardLiveAudienceActivity(liveBean, 0, 0, 0);
} else {
MainActivity.forward(mContext, false);
}

View File

@ -235,12 +235,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
}
});
RouteUtil.forwardLiveAudienceActivity(liveBean, 0, 0, 0);
} else {
RouteUtil.forwardUserHome(mContext, String.valueOf(live_id), 0);

View File

@ -326,12 +326,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
if (gotoRoomKey != null && gotoRoomKey.isEmpty()) {
gotoRoomKey = null;
}
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
}
});
RouteUtil.forwardLiveAudienceActivity(liveBean, 0, 0, 0);
} else {
intoIndex = 1;

View File

@ -416,12 +416,8 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
}
});
RouteUtil.forwardLiveAudienceActivity(liveBean, 0, 0, 0);
} else {
RouteUtil.forwardUserHome(mContext, event.getLiveuid(), 0);
}