Commit 0d167ce7 by YKai

feat: ModularServiceManager.provider改为findRouteService,代码格式化

parent 220aae18
...@@ -26,9 +26,7 @@ class AudioImServiceImp : IAudioImService { ...@@ -26,9 +26,7 @@ class AudioImServiceImp : IAudioImService {
} }
override fun loginRtm(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) { override fun loginRtm(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) {
YDLavManager.instances.login(userId) { success: Boolean, _ -> YDLavManager.instances.login(userId, event)
event(success, "")
}
} }
override fun loginRtm(userId: String?) { override fun loginRtm(userId: String?) {
......
package com.ydl.confide.home package com.ydl.confide.home
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
...@@ -52,7 +51,6 @@ import com.ydl.webview.NewH5Activity ...@@ -52,7 +51,6 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.base.config.HttpConfig.Companion.YDL_H5 import com.ydl.ydlcommon.base.config.HttpConfig.Companion.YDL_H5
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
...@@ -62,7 +60,6 @@ import com.ydl.ydlcommon.view.DrawableRightTextView ...@@ -62,7 +60,6 @@ import com.ydl.ydlcommon.view.DrawableRightTextView
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.im.api.service.IImService import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.main.confide_home_activity.* import kotlinx.android.synthetic.main.confide_home_activity.*
...@@ -251,8 +248,8 @@ class ConfideHomeActivity : ...@@ -251,8 +248,8 @@ class ConfideHomeActivity :
} }
if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()) { if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()) {
if (!ModularServiceManager.provide(IAudioImService::class.java).getIsOnlineRtm()) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
ModularServiceManager.provide(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { _: Boolean, _ -> findRouteService(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { _: Boolean, _ ->
showPayOrDetail(confidedId, doctorId) showPayOrDetail(confidedId, doctorId)
} }
} else { } else {
......
...@@ -18,7 +18,7 @@ import com.ydl.confide.home.bean.ConfideConnectResponse ...@@ -18,7 +18,7 @@ import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.webview.TellData import com.ydl.webview.TellData
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
/** /**
...@@ -72,7 +72,7 @@ class ConfdieServiceImpl : IConfideService { ...@@ -72,7 +72,7 @@ class ConfdieServiceImpl : IConfideService {
override fun ydlAvManagerLogin(uid: String?) { override fun ydlAvManagerLogin(uid: String?) {
ModularServiceManager.provide(IAudioImService::class.java).loginRtm(uid) findRouteService(IAudioImService::class.java).loginRtm(uid)
} }
override fun startCondifeHomePage(context: Context, isSplash: Boolean) { override fun startCondifeHomePage(context: Context, isSplash: Boolean) {
...@@ -108,15 +108,15 @@ class ConfdieServiceImpl : IConfideService { ...@@ -108,15 +108,15 @@ class ConfdieServiceImpl : IConfideService {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830" avManagerKey = "3387e9b251f3491e9221a9877e8f7830"
} }
ModularServiceManager.provide(IAudioImService::class.java).yDLAvManagerInit(app,avManagerKey) findRouteService(IAudioImService::class.java).yDLAvManagerInit(app, avManagerKey)
} }
override fun isOnlineRtm(): Boolean { override fun isOnlineRtm(): Boolean {
return ModularServiceManager.provide(IAudioImService::class.java).getIsOnlineRtm() return findRouteService(IAudioImService::class.java).getIsOnlineRtm()
} }
override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) { override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) {
ModularServiceManager.provide(IAudioImService::class.java).openAxbDialog(activity,type,phoneNumber) findRouteService(IAudioImService::class.java).openAxbDialog(activity, type, phoneNumber)
} }
override fun closePlayer() { override fun closePlayer() {
......
...@@ -18,7 +18,6 @@ import com.ydl.confide.router.PhoneCallIn ...@@ -18,7 +18,6 @@ import com.ydl.confide.router.PhoneCallIn
import com.ydl.webview.H5Params import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity import com.ydl.webview.NewH5Activity
import com.ydl.webview.TellData import com.ydl.webview.TellData
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.ui.Loading import com.ydl.ydlcommon.ui.Loading
import com.ydl.ydlcommon.utils.log.AliYunLogConfig import com.ydl.ydlcommon.utils.log.AliYunLogConfig
...@@ -107,7 +106,7 @@ class ConfideWebServiceImpl { ...@@ -107,7 +106,7 @@ class ConfideWebServiceImpl {
data: ConfideConnectResponse? data: ConfideConnectResponse?
) { ) {
val expertInfo = data?.dialDetail?.agoraExpertInfo ?: return val expertInfo = data?.dialDetail?.agoraExpertInfo ?: return
if (!ModularServiceManager.provide(IAudioImService::class.java).getIsOnlineRtm()) { // 判断如果账号在其它设备登录rtm是否在线 if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) { // 判断如果账号在其它设备登录rtm是否在线
ToastUtil.toastShort("网络通话错误代码001") ToastUtil.toastShort("网络通话错误代码001")
return return
} }
...@@ -128,7 +127,7 @@ class ConfideWebServiceImpl { ...@@ -128,7 +127,7 @@ class ConfideWebServiceImpl {
fun axb(activity: Activity, phone: String?) { fun axb(activity: Activity, phone: String?) {
if (phone.isNullOrEmpty()) if (phone.isNullOrEmpty())
return return
ModularServiceManager.provide(IAudioImService::class.java).openAxbDialog(activity,1,phone) findRouteService(IAudioImService::class.java).openAxbDialog(activity,1,phone)
} }
//java版axb和声网接口 //java版axb和声网接口
...@@ -140,8 +139,8 @@ class ConfideWebServiceImpl { ...@@ -140,8 +139,8 @@ class ConfideWebServiceImpl {
tellData: TellData?, tellData: TellData?,
callType: String? callType: String?
) { ) {
if (!ModularServiceManager.provide(IAudioImService::class.java).getIsOnlineRtm()) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
ModularServiceManager.provide(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ -> findRouteService(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) { if (isSuccess) {
toDial(id, type, callType, activity, tellData) toDial(id, type, callType, activity, tellData)
} else { } else {
...@@ -326,7 +325,7 @@ class ConfideWebServiceImpl { ...@@ -326,7 +325,7 @@ class ConfideWebServiceImpl {
expertInfo.remainingTime = expertInfo.remainingTime =
ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration); ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration);
} }
ModularServiceManager.provide(IAudioImService::class.java).callEventSave("10","用户点击拨打",expertInfo.channelId, "7") findRouteService(IAudioImService::class.java).callEventSave("10", "用户点击拨打", expertInfo.channelId, "7")
Loading.close() Loading.close()
ARouter.getInstance().build("/av/AudioHomeActivity") ARouter.getInstance().build("/av/AudioHomeActivity")
.withString(IntentConstants.INTENT_EXPERT_HEAD_URL, expertInfo.expertHeadUrl) .withString(IntentConstants.INTENT_EXPERT_HEAD_URL, expertInfo.expertHeadUrl)
......
...@@ -27,7 +27,6 @@ import com.ydl.confide.router.PhoneCallIn ...@@ -27,7 +27,6 @@ import com.ydl.confide.router.PhoneCallIn
import com.ydl.webview.H5Params import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
...@@ -37,7 +36,6 @@ import io.reactivex.Observable ...@@ -37,7 +36,6 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.confide_home_activity.*
import tv.danmaku.ijk.media.player.IjkMediaPlayer import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.io.UnsupportedEncodingException import java.io.UnsupportedEncodingException
import java.net.URLDecoder import java.net.URLDecoder
...@@ -124,8 +122,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -124,8 +122,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
} }
else -> { else -> {
if (!item.confideId.isNullOrBlank()) { if (!item.confideId.isNullOrBlank()) {
if (!ModularServiceManager.provide(IAudioImService::class.java).getIsOnlineRtm()) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
ModularServiceManager.provide(IAudioImService::class.java).loginRtm( findRouteService(IAudioImService::class.java).loginRtm(
PhoneCallIn.getUserService().getUserInfo()?.uid PhoneCallIn.getUserService().getUserInfo()?.uid
) { _: Boolean, _ -> ) { _: Boolean, _ ->
showPayOrDetail(item, it) showPayOrDetail(item, it)
......
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