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
a6393309
Commit
a6393309
authored
Apr 07, 2020
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
声网日志文件和路径更改
parent
47450d5e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
181 additions
and
13 deletions
+181
-13
config.gradle
config.gradle
+4
-4
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+1
-0
ConnectExceptionCommand.kt
m-audioim/src/main/java/com/ydl/audioim/http/command/ConnectExceptionCommand.kt
+2
-1
ConsultantAudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
+14
-8
SessionHelper.java
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
+3
-0
CustomAttachConsultCallStatus.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachConsultCallStatus.java
+55
-0
CustomAttachParser.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachParser.java
+4
-0
CustomAttachmentType.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentType.java
+1
-0
MsgViewHolderConsultCallStatus.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderConsultCallStatus.java
+68
-0
im_ui_message_custom_consult_call_status.xml
m-im/src/main/res/layout/im_ui_message_custom_consult_call_status.xml
+29
-0
No files found.
config.gradle
View file @
a6393309
...
...
@@ -42,12 +42,12 @@ ext {
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.48.7.
19
"
,
"m-confide"
:
"0.0.48.7.
22
"
,
"m-consultant"
:
"0.0.57.4"
,
"m-fm"
:
"0.0.29.3"
,
"m-user"
:
"0.0.60.1"
,
"m-home"
:
"0.0.19.1"
,
"m-im"
:
"0.0.17.
0
"
,
"m-im"
:
"0.0.17.
8
"
,
"m-dynamic"
:
"0.0.7.5"
,
"m-muse"
:
"0.0.28.9"
,
...
...
@@ -75,7 +75,7 @@ ext {
"ydl-webview"
:
"0.0.38.24"
,
"ydl-media"
:
"0.0.20"
,
"ydl-pay"
:
"0.0.17"
,
"m-audioim"
:
"0.0.48.3.1
0
"
,
"m-audioim"
:
"0.0.48.3.1
2
"
,
"ydl-flutter-base"
:
"0.0.10.9"
,
//以下 几乎不会动
...
...
@@ -121,7 +121,7 @@ ext {
"ydl-webview"
:
"0.0.38.24"
,
"ydl-media"
:
"0.0.20"
,
"ydl-pay"
:
"0.0.17"
,
"m-audioim"
:
"0.0.48.3.1
0
"
,
"m-audioim"
:
"0.0.48.3.1
2
"
,
"ydl-flutter-base"
:
"0.0.10.9"
,
//以下 几乎不会动
...
...
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
a6393309
...
...
@@ -202,6 +202,7 @@ class AudioHomeActivity :
override
fun
onError
(
err
:
Int
)
{
super
.
onError
(
err
)
uploadException
(
"mRtcEventHandler-onError:errorCode--%${err}"
)
uploadLog
()
//3:SDK 初始化失败。Agora 建议尝试以下处理方法
//7:SDK 尚未初始化,就调用其 API。请确认在调用 API 之前已创建 RtcEngine 对象并完成初始化
//10:API 调用超时。有些 API 调用需要 SDK 返回结果,如果 SDK 处理时间过长,超过 10 秒没有返回,会出现此错误
...
...
m-audioim/src/main/java/com/ydl/audioim/http/command/ConnectExceptionCommand.kt
View file @
a6393309
...
...
@@ -10,7 +10,8 @@ data class ConnectExceptionCommand(
var
noticeId
:
String
,
// 秒级
var
productId
:
String
,
// 2
var
eventType
:
String
,
// 99
var
payload
:
PayLoad
var
payload
:
PayLoad
,
var
callStatus
:
Int
=-
1
//用于判断咨询声网时是哪方取消的:1 主叫取消 2被叫拒绝 (超时未接听算主叫取消)
)
:
BaseCommand
()
data class
PayLoad
(
...
...
m-audioim/src/main/java/com/ydl/consultantim/ConsultantAudioHomeActivity.kt
View file @
a6393309
...
...
@@ -103,6 +103,7 @@ class ConsultantAudioHomeActivity :
//频道token
private
var
channelToken
:
String
?
=
null
private
var
hasUpLoadLog
=
false
private
var
callStatus
:
Int
=
-
1
/**
* 是否连接成功
...
...
@@ -138,7 +139,7 @@ class ConsultantAudioHomeActivity :
//5s倒计时,5s后还是连接中,则直接关闭页面
connectingStatusWaitingTimeCount
()
tv_tips
.
visibility
=
View
.
INVISIBLE
tv_tips
.
visibility
=
View
.
INVISIBLE
}
}
...
...
@@ -775,12 +776,8 @@ class ConsultantAudioHomeActivity :
//关闭本页面
fun
close
(
code
:
Int
,
msg
:
String
)
{
runOnUiThread
{
LogUtil
.
e
(
"[agora]close(code:$code,msg:$msg)"
)
if
(
status
==
STATUS_ANSWERED
)
{
//不再做操作,原先为调用接口
}
stopMusic
()
//播放结束音频
playFinishMusic
()
...
...
@@ -789,9 +786,13 @@ class ConsultantAudioHomeActivity :
//离开频道
leaveChannel
()
}
else
if
(
code
==
RESULT_NOT_ANSWERED_CODE
)
{
callStatus
=
2
uploadException
(
"被叫拒绝"
,
zhu
=
""
)
//未接听,直接挂断 发送消息
YDLRTMClient
.
instances
.
refuseCall
(
mAudioMessageBean
?.
channelId
)
}
else
if
(
code
==
RESULT_USER_CANCEL
)
{
callStatus
=
1
uploadException
(
"主叫取消"
,
zhu
=
""
)
ToastUtil
.
toastShort
(
"对方已挂断"
)
}
finish
()
...
...
@@ -899,7 +900,7 @@ class ConsultantAudioHomeActivity :
private
fun
writeAgoraLog
(
content
:
String
)
{
Observable
.
create
<
Any
>
{
try
{
AudioLogUtils
.
writeAgoraLog
(
content
,
"consult"
)
AudioLogUtils
.
writeAgoraLog
(
content
,
"consult"
)
}
catch
(
e
:
Exception
)
{
}
}.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -909,12 +910,17 @@ class ConsultantAudioHomeActivity :
/**
* 上传错误日志
*/
private
fun
uploadException
(
message
:
String
,
zhu
:
String
=
""
,
eventType
:
String
=
"99"
)
{
private
fun
uploadException
(
message
:
String
,
zhu
:
String
=
""
,
eventType
:
String
=
"99"
)
{
var
time
:
String
=
(
System
.
currentTimeMillis
()
/
1000
).
toString
()
var
uid
:
String
=
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
).
getUserInfo
()
?.
uid
!!
var
payLoad
=
PayLoad
(
mAudioMessageBean
?.
channelId
?:
"0"
,
time
,
uid
,
"1"
,
"999"
,
message
)
var
connectException
=
ConnectExceptionCommand
(
time
+
zhu
,
"2"
,
eventType
,
payLoad
)
var
connectException
=
ConnectExceptionCommand
(
time
+
zhu
,
"2"
,
eventType
,
payLoad
,
callStatus
)
YDLavManager
.
instances
.
uploadException
(
connectException
)
}
...
...
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
View file @
a6393309
...
...
@@ -36,6 +36,7 @@ import com.yidianling.im.session.action.SendCardAction;
import
com.yidianling.im.session.action.TeamAVChatAction
;
import
com.yidianling.im.session.extension.CustomAttachChatTipMsg
;
import
com.yidianling.im.session.extension.CustomAttachConsult
;
import
com.yidianling.im.session.extension.CustomAttachConsultCallStatus
;
import
com.yidianling.im.session.extension.CustomAttachConsultPerfectData
;
import
com.yidianling.im.session.extension.CustomAttachConsultSubScript
;
import
com.yidianling.im.session.extension.CustomAttachModifyTime
;
...
...
@@ -64,6 +65,7 @@ import com.yidianling.im.session.extension.StickerAttachment;
import
com.yidianling.im.session.viewholder.MsgViewHolderAVChat
;
import
com.yidianling.im.session.viewholder.MsgViewHolderChatTip
;
import
com.yidianling.im.session.viewholder.MsgViewHolderConsult
;
import
com.yidianling.im.session.viewholder.MsgViewHolderConsultCallStatus
;
import
com.yidianling.im.session.viewholder.MsgViewHolderConsultSubScribe
;
import
com.yidianling.im.session.viewholder.MsgViewHolderCustomTip
;
import
com.yidianling.im.session.viewholder.MsgViewHolderCustomerServiceCard
;
...
...
@@ -412,6 +414,7 @@ public class SessionHelper {
NimUIKit
.
registerMsgItemViewHolder
(
CustomAttachPleaseSubscribeConsultDate
.
class
,
MsgViewHolderPleaseSubscribeConsultDate
.
class
);
//请预约咨询时间
NimUIKit
.
registerMsgItemViewHolder
(
CustomCustomerServiceCardAttachment
.
class
,
MsgViewHolderCustomerServiceCard
.
class
);
//客服小壹名片
NimUIKit
.
registerMsgItemViewHolder
(
CustomAttachmentShareMsg
.
class
,
MsgViewHolderShareMsg
.
class
);
//分享推送
NimUIKit
.
registerMsgItemViewHolder
(
CustomAttachConsultCallStatus
.
class
,
MsgViewHolderConsultCallStatus
.
class
);
//咨询声网的拨打状态
}
private
static
void
setSessionListener
()
{
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachConsultCallStatus.java
0 → 100644
View file @
a6393309
package
com
.
yidianling
.
im
.
session
.
extension
;
import
com.alibaba.fastjson.JSONObject
;
/**
* Created by Wi1ls on 2016/11/28;
*/
public
class
CustomAttachConsultCallStatus
extends
CustomAttachment
{
private
final
String
KEY_STATUS
=
"status"
;
private
final
String
KEY_CALLER
=
"caller"
;
private
final
String
KEY_CALLEE
=
"callee"
;
private
final
String
KEY_DURATION
=
"duration"
;
private
String
status
;
private
String
caller
;
private
String
callee
;
private
String
duration
;
public
CustomAttachConsultCallStatus
()
{
super
(
CustomAttachmentType
.
TYPE_CUSTOMER_CONSULT_CALL_STATUS
);
}
@Override
protected
void
parseData
(
JSONObject
data
)
{
this
.
status
=
data
.
getString
(
KEY_STATUS
);
this
.
caller
=
data
.
getString
(
KEY_CALLER
);
this
.
callee
=
data
.
getString
(
KEY_CALLEE
);
this
.
duration
=
data
.
getString
(
KEY_DURATION
);
}
@Override
protected
JSONObject
packData
()
{
JSONObject
data
=
new
JSONObject
();
data
.
put
(
KEY_STATUS
,
status
);
data
.
put
(
KEY_CALLER
,
caller
);
data
.
put
(
KEY_CALLEE
,
callee
);
data
.
put
(
KEY_DURATION
,
duration
);
return
data
;
}
public
String
getStatus
()
{
return
status
;
}
public
String
getCaller
()
{
return
caller
;
}
public
String
getCallee
()
{
return
callee
;
}
public
String
getDuration
()
{
return
duration
;
}
}
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachParser.java
View file @
a6393309
...
...
@@ -111,6 +111,10 @@ public class CustomAttachParser implements MsgAttachmentParser {
//分享消息,倾诉推荐,课程,测评,文章
attachment
=
new
CustomAttachmentShareMsg
();
break
;
case
CustomAttachmentType
.
TYPE_CUSTOMER_CONSULT_CALL_STATUS
:
//咨询的声网拨打状态的自定义消息
attachment
=
new
CustomAttachConsultCallStatus
();
break
;
default
:
attachment
=
new
DefaultCustomAttachment
();
break
;
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentType.java
View file @
a6393309
...
...
@@ -33,4 +33,5 @@ public interface CustomAttachmentType {
int
TYPE_PLEASE_SUBSCRIBE_CONSULT_DATE
=
29
;
//请预约咨询时间
int
TYPE_PUSH_SHARE
=
30
;
// 分享,倾诉推荐,课程,测评,文章
int
TYPE_CUSTOMER_SERVICE
=
31
;
//客服名片
int
TYPE_CUSTOMER_CONSULT_CALL_STATUS
=
32
;
//咨询的声网拨打状态的自定义消息
}
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderConsultCallStatus.java
0 → 100644
View file @
a6393309
package
com
.
yidianling
.
im
.
session
.
viewholder
;
import
android.graphics.Color
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
com.yidianling.im.R
;
import
com.yidianling.im.session.extension.CustomAttachConsultCallStatus
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
import
com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
;
/**
* Created by zhoujianghua on 2015/8/6.
*/
public
class
MsgViewHolderConsultCallStatus
extends
MsgViewHolderBase
{
private
ImageView
typeImage
;
private
TextView
statusLabel
;
public
MsgViewHolderConsultCallStatus
(
BaseMultiItemFetchLoadAdapter
adapter
)
{
super
(
adapter
);
}
@Override
protected
int
getContentResId
()
{
return
R
.
layout
.
im_ui_message_custom_consult_call_status
;
}
@Override
protected
void
inflateContentView
()
{
typeImage
=
findViewById
(
R
.
id
.
type_img
);
statusLabel
=
findViewById
(
R
.
id
.
tv_state
);
}
@Override
protected
void
bindContentView
()
{
CustomAttachConsultCallStatus
customAttachTipMsg
=
(
CustomAttachConsultCallStatus
)
message
.
getAttachment
();
layoutByDirection
(
customAttachTipMsg
);
}
private
void
layoutByDirection
(
CustomAttachConsultCallStatus
customAttachTipMsg
)
{
if
(
isReceivedMessage
())
{
typeImage
.
setImageResource
(
R
.
drawable
.
im_avchat_left_type_audio
);
statusLabel
.
setTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
platform_color_grey_999999
));
}
else
{
typeImage
.
setImageResource
(
R
.
drawable
.
im_avchat_right_type_audio
);
statusLabel
.
setTextColor
(
Color
.
WHITE
);
}
if
(
TextUtils
.
equals
(
"1"
,
customAttachTipMsg
.
getStatus
()))
{
typeImage
.
setVisibility
(
View
.
VISIBLE
);
statusLabel
.
setText
(
customAttachTipMsg
.
getDuration
());
}
else
{
typeImage
.
setVisibility
(
View
.
GONE
);
if
(
isReceivedMessage
())
{
statusLabel
.
setText
(
customAttachTipMsg
.
getCallee
());
}
else
{
statusLabel
.
setText
(
customAttachTipMsg
.
getCaller
());
}
}
}
}
m-im/src/main/res/layout/im_ui_message_custom_consult_call_status.xml
0 → 100644
View file @
a6393309
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/ll_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:padding=
"6dp"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/type_img"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"3dp"
android:layout_marginRight=
"8dp"
android:contentDescription=
"@string/im_empty"
android:src=
"@drawable/im_avchat_left_type_audio"
/>
<TextView
android:id=
"@+id/tv_state"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginRight=
"5dp"
android:text=
"无人接听"
android:textColor=
"@color/im_color_grey_999999"
android:textSize=
"14sp"
/>
</LinearLayout>
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