Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
b4f45bd1
Commit
b4f45bd1
authored
Nov 28, 2019
by
徐健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除声网连接与完成接口的调用,增加声网异常上传接口的调用
parent
97b65d46
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
96 additions
and
23 deletions
+96
-23
config.gradle
config.gradle
+3
-3
build.gradle
m-audioim/build.gradle
+2
-0
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+16
-4
IAudioHomeActivityContract.kt
m-audioim/src/main/java/com/ydl/audioim/contract/IAudioHomeActivityContract.kt
+11
-4
AudioApiRequestUtil.kt
m-audioim/src/main/java/com/ydl/audioim/http/AudioApiRequestUtil.kt
+13
-4
AudioNetAPi.kt
m-audioim/src/main/java/com/ydl/audioim/http/AudioNetAPi.kt
+7
-0
ConnectExceptionCommand.kt
m-audioim/src/main/java/com/ydl/audioim/http/command/ConnectExceptionCommand.kt
+24
-0
AudioHomeModelImpl.kt
m-audioim/src/main/java/com/ydl/audioim/model/AudioHomeModelImpl.kt
+5
-4
AudioHomePresenterImpl.kt
m-audioim/src/main/java/com/ydl/audioim/presenter/AudioHomePresenterImpl.kt
+15
-4
No files found.
config.gradle
View file @
b4f45bd1
...
@@ -43,7 +43,7 @@ ext {
...
@@ -43,7 +43,7 @@ ext {
// -------------- 业务模块 --------------
// -------------- 业务模块 --------------
//第三步 若干
//第三步 若干
"m-confide"
:
"0.0.31"
,
"m-confide"
:
"0.0.31
.8
"
,
"m-consultant"
:
"0.0.44"
,
"m-consultant"
:
"0.0.44"
,
"m-course"
:
"0.0.30"
,
"m-course"
:
"0.0.30"
,
"m-fm"
:
"0.0.21"
,
"m-fm"
:
"0.0.21"
,
...
@@ -70,7 +70,7 @@ ext {
...
@@ -70,7 +70,7 @@ ext {
"ydl-webview"
:
"0.0.28"
,
"ydl-webview"
:
"0.0.28"
,
"ydl-media"
:
"0.0.14"
,
"ydl-media"
:
"0.0.14"
,
"ydl-pay"
:
"0.0.11"
,
"ydl-pay"
:
"0.0.11"
,
"m-audioim"
:
"0.0.3
0
"
,
"m-audioim"
:
"0.0.3
1.9
"
,
//以下 几乎不会动
//以下 几乎不会动
"router"
:
"0.0.1"
,
"router"
:
"0.0.1"
,
...
@@ -107,7 +107,7 @@ ext {
...
@@ -107,7 +107,7 @@ ext {
"ydl-webview"
:
"0.0.28"
,
"ydl-webview"
:
"0.0.28"
,
"ydl-media"
:
"0.0.14"
,
"ydl-media"
:
"0.0.14"
,
"ydl-pay"
:
"0.0.11"
,
"ydl-pay"
:
"0.0.11"
,
"m-audioim"
:
"0.0.3
0
"
,
"m-audioim"
:
"0.0.3
1.9
"
,
//以下 几乎不会动
//以下 几乎不会动
...
...
m-audioim/build.gradle
View file @
b4f45bd1
...
@@ -83,10 +83,12 @@ dependencies {
...
@@ -83,10 +83,12 @@ dependencies {
//开发时使用
//开发时使用
api
project
(
':ydl-platform'
)
api
project
(
':ydl-platform'
)
api
project
(
':ydl-webview'
)
api
project
(
':ydl-webview'
)
implementation
modularPublication
(
'com.ydl:m-user-api'
)
implementation
modularPublication
(
'com.ydl:m-audioim-api'
)
implementation
modularPublication
(
'com.ydl:m-audioim-api'
)
}
else
{
}
else
{
//发布时使用
//发布时使用
api
rootProject
.
ext
.
dependencies
[
"ydl-webview"
]
api
rootProject
.
ext
.
dependencies
[
"ydl-webview"
]
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-user-api"
]
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-audioim-api"
]
compileOnly
rootProject
.
ext
.
dependencies
[
"ydl-m-audioim-api"
]
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
api
(
rootProject
.
ext
.
dependencies
[
"ydl-platform"
])
{
transitive
=
true
transitive
=
true
...
...
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
b4f45bd1
...
@@ -38,10 +38,7 @@ import com.ydl.ydl_image.config.SimpleImageOpConfiger
...
@@ -38,10 +38,7 @@ import com.ydl.ydl_image.config.SimpleImageOpConfiger
import
com.ydl.ydl_image.manager.YDLImageCacheManager
import
com.ydl.ydl_image.manager.YDLImageCacheManager
import
com.ydl.ydl_av.chat.bean.AudioMessageBean
import
com.ydl.ydl_av.chat.bean.AudioMessageBean
import
com.ydl.audioim.contract.IAudioHomeActivityContract
import
com.ydl.audioim.contract.IAudioHomeActivityContract
import
com.ydl.audioim.http.command.ConnectCommand
import
com.ydl.audioim.http.command.*
import
com.ydl.audioim.http.command.ConnectFinishCommand
import
com.ydl.audioim.http.command.ConnectStartCommand
import
com.ydl.audioim.http.command.NoticePushCommand
import
com.ydl.audioim.player.AudioPlayer
import
com.ydl.audioim.player.AudioPlayer
import
com.ydl.audioim.presenter.AudioHomePresenterImpl
import
com.ydl.audioim.presenter.AudioHomePresenterImpl
import
com.ydl.audioim.utils.DateUtils
import
com.ydl.audioim.utils.DateUtils
...
@@ -51,10 +48,12 @@ import com.ydl.webview.H5Params
...
@@ -51,10 +48,12 @@ import com.ydl.webview.H5Params
import
com.ydl.webview.NewH5Activity
import
com.ydl.webview.NewH5Activity
import
com.ydl.webview.RefreshWebEvent
import
com.ydl.webview.RefreshWebEvent
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.remind.ToastHelper
import
com.ydl.ydlcommon.utils.remind.ToastHelper
import
com.yidianling.user.api.service.IUserService
import
de.greenrobot.event.EventBus
import
de.greenrobot.event.EventBus
import
io.agora.rtc.IRtcEngineEventHandler
import
io.agora.rtc.IRtcEngineEventHandler
import
io.reactivex.Observable
import
io.reactivex.Observable
...
@@ -174,6 +173,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
...
@@ -174,6 +173,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
override
fun
onWarning
(
warn
:
Int
)
{
override
fun
onWarning
(
warn
:
Int
)
{
super
.
onWarning
(
warn
)
super
.
onWarning
(
warn
)
uploadException
(
"mRtcEventHandler-onWarning:warnCode--%${warn}"
)
//103:没有可用的频道资源。可能是因为服务端没法分配频道资源
//103:没有可用的频道资源。可能是因为服务端没法分配频道资源
//104:查找频道超时。在加入频道时 SDK 先要查找指定的频道,出现该警告一般是因为网络太差,连接不到服务器
//104:查找频道超时。在加入频道时 SDK 先要查找指定的频道,出现该警告一般是因为网络太差,连接不到服务器
//105:查找频道请求被服务器拒绝。服务器可能没有办法处理这个请求或请求是非法的
//105:查找频道请求被服务器拒绝。服务器可能没有办法处理这个请求或请求是非法的
...
@@ -192,6 +192,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
...
@@ -192,6 +192,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
override
fun
onError
(
err
:
Int
)
{
override
fun
onError
(
err
:
Int
)
{
super
.
onError
(
err
)
super
.
onError
(
err
)
uploadException
(
"mRtcEventHandler-onError:errorCode--%${err}"
)
//3:SDK 初始化失败。Agora 建议尝试以下处理方法
//3:SDK 初始化失败。Agora 建议尝试以下处理方法
//7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化
//7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化
//10:API 调用超时。有些 API 调用需要 SDK 返回结果,如果 SDK 处理时间过长,超过 10 秒没有返回,会出现此错误
//10:API 调用超时。有些 API 调用需要 SDK 返回结果,如果 SDK 处理时间过长,超过 10 秒没有返回,会出现此错误
...
@@ -288,6 +289,17 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
...
@@ -288,6 +289,17 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
}
}
//
//
/**
* 上传错误日志
*/
private
fun
uploadException
(
message
:
String
)
{
var
time
:
String
=
(
System
.
currentTimeMillis
()
/
1000
).
toString
()
var
uid
:
String
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
?.
uid
!!
var
payLoad
=
PayLoad
(
channelId
?:
"0"
,
time
,
uid
,
"1"
,
"999"
,
message
)
var
connectException
=
ConnectExceptionCommand
(
time
,
"2"
,
"99"
,
payLoad
)
getPresenter
().
connectException
(
connectException
)
}
override
fun
createPresenter
():
IAudioHomeActivityContract
.
Presenter
{
override
fun
createPresenter
():
IAudioHomeActivityContract
.
Presenter
{
return
AudioHomePresenterImpl
()
return
AudioHomePresenterImpl
()
}
}
...
...
m-audioim/src/main/java/com/ydl/audioim/contract/IAudioHomeActivityContract.kt
View file @
b4f45bd1
package
com.ydl.audioim.contract
package
com.ydl.audioim.contract
import
com.ydl.audioim.bean.ConnectBean
import
com.ydl.audioim.bean.ConnectBean
import
com.ydl.audioim.http.command.ConnectCommand
import
com.ydl.audioim.http.command.*
import
com.ydl.audioim.http.command.ConnectFinishCommand
import
com.ydl.audioim.http.command.ConnectStartCommand
import
com.ydl.audioim.http.command.NoticePushCommand
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.mvp.base.BasePresenter
...
@@ -74,6 +71,11 @@ interface IAudioHomeActivityContract {
...
@@ -74,6 +71,11 @@ interface IAudioHomeActivityContract {
*/
*/
// fun connectFinish(param: ConnectFinishCommand)
// fun connectFinish(param: ConnectFinishCommand)
/**
* 通话异常
*/
fun
connectException
(
param
:
ConnectExceptionCommand
)
/**
/**
* 通知服务端发送推送
* 通知服务端发送推送
...
@@ -98,6 +100,11 @@ interface IAudioHomeActivityContract {
...
@@ -98,6 +100,11 @@ interface IAudioHomeActivityContract {
*/
*/
// fun connectFinish(param: ConnectFinishCommand): Observable<BaseAPIResponse<Any>>
// fun connectFinish(param: ConnectFinishCommand): Observable<BaseAPIResponse<Any>>
/**
* 通话异常
*/
fun
connectException
(
param
:
ConnectExceptionCommand
):
Observable
<
BaseAPIResponse
<
Any
>>
/**
/**
* 通知服务端发送推送
* 通知服务端发送推送
...
...
m-audioim/src/main/java/com/ydl/audioim/http/AudioApiRequestUtil.kt
View file @
b4f45bd1
...
@@ -3,10 +3,7 @@ package com.ydl.audioim.http
...
@@ -3,10 +3,7 @@ package com.ydl.audioim.http
import
com.google.gson.Gson
import
com.google.gson.Gson
import
com.ydl.audioim.bean.AgoraTokenResponse
import
com.ydl.audioim.bean.AgoraTokenResponse
import
com.ydl.audioim.bean.ConnectBean
import
com.ydl.audioim.bean.ConnectBean
import
com.ydl.audioim.http.command.ConnectCommand
import
com.ydl.audioim.http.command.*
import
com.ydl.audioim.http.command.NoticePushCommand
import
com.ydl.audioim.http.command.ConnectFinishCommand
import
com.ydl.audioim.http.command.ConnectStartCommand
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.RxUtils
...
@@ -62,6 +59,18 @@ class AudioApiRequestUtil {
...
@@ -62,6 +59,18 @@ class AudioApiRequestUtil {
// }
// }
/**
/**
* 通话警告与异常回调
*
* @param param
* @return
*/
fun
connectException
(
param
:
ConnectExceptionCommand
):
Observable
<
BaseAPIResponse
<
Any
>>
{
var
str
=
Gson
().
toJson
(
param
)
val
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
str
)
as
RequestBody
return
YDLHttpUtils
.
obtainApi
(
AudioNetAPi
::
class
.
java
).
connectException
(
body
)
}
/**
* 通知服务端发送推送
* 通知服务端发送推送
*/
*/
fun
noticeServerPush
(
param
:
NoticePushCommand
):
Observable
<
BaseResponse
<
Any
>>
{
fun
noticeServerPush
(
param
:
NoticePushCommand
):
Observable
<
BaseResponse
<
Any
>>
{
...
...
m-audioim/src/main/java/com/ydl/audioim/http/AudioNetAPi.kt
View file @
b4f45bd1
...
@@ -32,6 +32,13 @@ interface AudioNetAPi {
...
@@ -32,6 +32,13 @@ interface AudioNetAPi {
// @POST("auth/listen-order/callback/agora/finish")
// @POST("auth/listen-order/callback/agora/finish")
// fun connectFinish(@Body body:RequestBody): Observable<BaseAPIResponse<Any>>
// fun connectFinish(@Body body:RequestBody): Observable<BaseAPIResponse<Any>>
/**
* 通话警告与错误回调
*/
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
,
"Content-Type:application/json"
)
@POST
(
"auth/listen-order/callback/agora"
)
fun
connectException
(
@Body
body
:
RequestBody
):
Observable
<
BaseAPIResponse
<
Any
>>
/**
/**
* 链接 :获取axb手机号
* 链接 :获取axb手机号
...
...
m-audioim/src/main/java/com/ydl/audioim/http/command/ConnectExceptionCommand.kt
0 → 100644
View file @
b4f45bd1
package
com.ydl.audioim.http.command
import
com.ydl.ydlcommon.data.http.BaseCommand
/**
连接异常请求bean
*/
data class
ConnectExceptionCommand
(
var
noticeId
:
String
,
// 秒级
var
productId
:
String
,
// 2
var
eventType
:
String
,
// 99
var
payload
:
PayLoad
)
:
BaseCommand
()
data class
PayLoad
(
var
channelName
:
String
,
// 房间id
var
ts
:
String
,
// 秒级
var
uid
:
String
,
var
platform
:
String
,
var
reason
:
String
,
var
message
:
String
)
\ No newline at end of file
m-audioim/src/main/java/com/ydl/audioim/model/AudioHomeModelImpl.kt
View file @
b4f45bd1
...
@@ -3,10 +3,7 @@ package com.ydl.audioim.model
...
@@ -3,10 +3,7 @@ package com.ydl.audioim.model
import
com.ydl.audioim.bean.ConnectBean
import
com.ydl.audioim.bean.ConnectBean
import
com.ydl.audioim.contract.IAudioHomeActivityContract
import
com.ydl.audioim.contract.IAudioHomeActivityContract
import
com.ydl.audioim.http.AudioApiRequestUtil
import
com.ydl.audioim.http.AudioApiRequestUtil
import
com.ydl.audioim.http.command.ConnectCommand
import
com.ydl.audioim.http.command.*
import
com.ydl.audioim.http.command.NoticePushCommand
import
com.ydl.audioim.http.command.ConnectFinishCommand
import
com.ydl.audioim.http.command.ConnectStartCommand
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
io.reactivex.Observable
import
io.reactivex.Observable
...
@@ -27,6 +24,10 @@ class AudioHomeModelImpl : IAudioHomeActivityContract.Model {
...
@@ -27,6 +24,10 @@ class AudioHomeModelImpl : IAudioHomeActivityContract.Model {
// return AudioApiRequestUtil.connectFinish(param)
// return AudioApiRequestUtil.connectFinish(param)
// }
// }
override
fun
connectException
(
param
:
ConnectExceptionCommand
):
Observable
<
BaseAPIResponse
<
Any
>>
{
return
AudioApiRequestUtil
.
connectException
(
param
)
}
override
fun
noticeServerPush
(
param
:
NoticePushCommand
):
Observable
<
BaseResponse
<
Any
>>
{
override
fun
noticeServerPush
(
param
:
NoticePushCommand
):
Observable
<
BaseResponse
<
Any
>>
{
return
AudioApiRequestUtil
.
noticeServerPush
(
param
)
return
AudioApiRequestUtil
.
noticeServerPush
(
param
)
}
}
...
...
m-audioim/src/main/java/com/ydl/audioim/presenter/AudioHomePresenterImpl.kt
View file @
b4f45bd1
...
@@ -3,10 +3,7 @@ package com.ydl.audioim.presenter
...
@@ -3,10 +3,7 @@ package com.ydl.audioim.presenter
import
com.ydl.audioim.BuildConfig
import
com.ydl.audioim.BuildConfig
import
com.ydl.ydl_av.chat.config.YDLChatParam
import
com.ydl.ydl_av.chat.config.YDLChatParam
import
com.ydl.audioim.contract.IAudioHomeActivityContract
import
com.ydl.audioim.contract.IAudioHomeActivityContract
import
com.ydl.audioim.http.command.ConnectCommand
import
com.ydl.audioim.http.command.*
import
com.ydl.audioim.http.command.ConnectFinishCommand
import
com.ydl.audioim.http.command.ConnectStartCommand
import
com.ydl.audioim.http.command.NoticePushCommand
import
com.ydl.audioim.model.AudioHomeModelImpl
import
com.ydl.audioim.model.AudioHomeModelImpl
import
com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.mvp.base.BasePresenter
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
...
@@ -68,6 +65,20 @@ class AudioHomePresenterImpl : BasePresenter<IAudioHomeActivityContract.View, IA
...
@@ -68,6 +65,20 @@ class AudioHomePresenterImpl : BasePresenter<IAudioHomeActivityContract.View, IA
// })
// })
// }
// }
override
fun
connectException
(
param
:
ConnectExceptionCommand
)
{
mModel
.
connectException
(
param
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doOnSubscribe
{
}
.
doAfterTerminate
{
}
.
subscribe
({
},
{
e
->
LogUtil
.
e
(
e
.
message
)
})
}
/**
/**
* 登录声网
* 登录声网
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment