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
ac42e349
Commit
ac42e349
authored
Feb 16, 2020
by
konghaorui
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
fa846e5a
' into feature/image_picker
parents
963a2b4e
fa846e5a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
161 additions
and
20 deletions
+161
-20
build.gradle
app/build.gradle
+1
-0
config.gradle
config.gradle
+3
-3
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+0
-0
AgoraLogInfoBean.kt
m-audioim/src/main/java/com/ydl/audioim/bean/AgoraLogInfoBean.kt
+44
-0
AudioLogUtils.kt
m-audioim/src/main/java/com/ydl/audioim/utils/AudioLogUtils.kt
+90
-0
LogHelper.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/log/LogHelper.kt
+23
-17
No files found.
app/build.gradle
View file @
ac42e349
...
@@ -205,6 +205,7 @@ dependencies {
...
@@ -205,6 +205,7 @@ dependencies {
// implementation project(':m-muse')
// implementation project(':m-muse')
implementation
project
(
':m-im'
)
implementation
project
(
':m-im'
)
implementation
project
(
':m-dynamic'
)
implementation
project
(
':m-dynamic'
)
implementation
project
(
':m-audioim'
)
// api rootProject.ext.dependencies["ydl-m-fm-module-ydl"]
// api rootProject.ext.dependencies["ydl-m-fm-module-ydl"]
...
...
config.gradle
View file @
ac42e349
...
@@ -42,7 +42,7 @@ ext {
...
@@ -42,7 +42,7 @@ ext {
ydlPublishVersion
=
[
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
// -------------- 业务模块 --------------
//第三步 若干
//第三步 若干
"m-confide"
:
"0.0.47.
1
"
,
"m-confide"
:
"0.0.47.
5
"
,
"m-consultant"
:
"0.0.56.1"
,
"m-consultant"
:
"0.0.56.1"
,
"m-fm"
:
"0.0.28"
,
"m-fm"
:
"0.0.28"
,
"m-user"
:
"0.0.58.1"
,
"m-user"
:
"0.0.58.1"
,
...
@@ -75,7 +75,7 @@ ext {
...
@@ -75,7 +75,7 @@ ext {
"ydl-webview"
:
"0.0.37.1"
,
"ydl-webview"
:
"0.0.37.1"
,
"ydl-media"
:
"0.0.20"
,
"ydl-media"
:
"0.0.20"
,
"ydl-pay"
:
"0.0.17"
,
"ydl-pay"
:
"0.0.17"
,
"m-audioim"
:
"0.0.46"
,
"m-audioim"
:
"0.0.46
.3
"
,
"ydl-flutter-base"
:
"0.0.10"
,
"ydl-flutter-base"
:
"0.0.10"
,
//以下 几乎不会动
//以下 几乎不会动
...
@@ -121,7 +121,7 @@ ext {
...
@@ -121,7 +121,7 @@ ext {
"ydl-webview"
:
"0.0.37.1"
,
"ydl-webview"
:
"0.0.37.1"
,
"ydl-media"
:
"0.0.20"
,
"ydl-media"
:
"0.0.20"
,
"ydl-pay"
:
"0.0.17"
,
"ydl-pay"
:
"0.0.17"
,
"m-audioim"
:
"0.0.46"
,
"m-audioim"
:
"0.0.46
.3
"
,
"ydl-flutter-base"
:
"0.0.10"
,
"ydl-flutter-base"
:
"0.0.10"
,
//以下 几乎不会动
//以下 几乎不会动
...
...
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
ac42e349
This diff is collapsed.
Click to expand it.
m-audioim/src/main/java/com/ydl/audioim/bean/AgoraLogInfoBean.kt
0 → 100644
View file @
ac42e349
package
com.ydl.audioim.bean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/2/12
*/
class
AgoraLogInfoBean
(
/**
* 专家头像地址
*/
private
var
expertHeadUrl
:
String
?
=
null
,
/**
* 专家姓名
*/
private
var
expertName
:
String
?
=
null
,
/**
* 声网点对点聊天房间id
*/
private
var
channelId
:
String
?
=
null
,
/**
* 倾诉剩余时长(时长单位s,eg:剩余2min15s,返回135)
*/
private
var
remainTime
:
String
?
=
null
,
/**
* listenerUid专家uid
*/
private
var
listenerUid
:
String
?
=
null
,
/**
* 倾述总时长
*/
private
var
totalDuration
:
Int
?
=
0
,
/**
* callId
*/
private
var
callId
:
String
?
=
null
,
/**
*聆听者id(不是聆听者的uid)
*/
private
var
listenId
:
String
?
=
null
)
\ No newline at end of file
m-audioim/src/main/java/com/ydl/audioim/utils/AudioLogUtils.kt
0 → 100644
View file @
ac42e349
package
com.ydl.audioim.utils
import
android.annotation.SuppressLint
import
com.ydl.audioim.BuildConfig
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxNetTool
import
io.reactivex.Observable
import
io.reactivex.schedulers.Schedulers
import
java.io.BufferedWriter
import
java.io.File
import
java.io.FileWriter
import
java.io.IOException
import
java.text.SimpleDateFormat
import
java.util.*
/**
* @author jiucheng
* @描述:记录声网双方信息相关的日志工具
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/2/12
*/
class
AudioLogUtils
{
companion
object
{
@SuppressLint
(
"SimpleDateFormat"
)
private
val
format
=
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
)
fun
writeAgoraLog
(
content
:
String
)
{
Observable
.
create
<
Any
>
{
try
{
writeLog
(
content
)
if
(
BuildConfig
.
DEBUG
)
{
LogUtil
.
d
(
"writeLog_complete"
)
}
}
catch
(
e
:
Exception
)
{
}
}.
subscribeOn
(
Schedulers
.
io
())
.
subscribe
()
}
private
fun
writeLog
(
content
:
String
)
{
try
{
val
folder
=
getLogFolder
()
val
file
=
File
(
folder
,
"AgoraInfoLog"
)
if
(!
file
.
exists
()
||
!
file
.
isFile
)
{
file
.
createNewFile
()
}
val
fileWriter
=
FileWriter
(
file
,
true
)
val
writer
=
BufferedWriter
(
fileWriter
)
writer
.
write
(
"""Time:${format.format(Calendar.getInstance().time)}"""
)
writer
.
newLine
()
writer
.
write
(
"UserUid = ${ModularServiceManager.getPlatformUserService()?.getUser()?.userId}"
)
writer
.
newLine
()
writer
.
write
(
"""Network:${RxNetTool.getNetWorkTypeName(BaseApp.getApp())}"""
)
writer
.
newLine
()
writer
.
write
(
"""DevicesInfo:${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()}"""
)
writer
.
newLine
()
writer
.
write
(
"""VersionInfo:${RxAppTool.getAppVersionName(BaseApp.getApp())}"""
)
writer
.
newLine
()
writer
.
write
(
"AgoraLog:$content"
)
writer
.
newLine
()
writer
.
write
(
"--------"
)
writer
.
newLine
()
writer
.
flush
()
writer
.
close
()
}
catch
(
e
:
IOException
)
{
e
.
printStackTrace
()
}
}
//获取app运行日志文件夹
private
fun
getLogFolder
():
File
{
val
cacheDir
=
BaseApp
.
getApp
().
externalCacheDir
.
absolutePath
val
logFolder
=
File
(
cacheDir
,
"log"
)
if
(!
logFolder
.
exists
()
||
!
logFolder
.
isDirectory
)
{
logFolder
.
mkdir
()
}
val
folder
=
File
(
logFolder
,
"NewYdlApp"
)
if
(!
folder
.
exists
()
||
!
folder
.
isDirectory
)
{
folder
.
mkdir
()
}
return
folder
}
}
}
\ No newline at end of file
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/log/LogHelper.kt
View file @
ac42e349
package
com.ydl.ydlcommon.utils.log
package
com.ydl.ydlcommon.utils.log
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.util.Log
import
android.util.Log
import
com.yidianling.common.tools.*
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.data.PlatformDataManager
import
com.ydl.ydlcommon.data.PlatformDataManager
import
com.ydl.ydlcommon.data.http.LogParam
import
com.ydl.ydlcommon.data.http.LogParam
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.FileUtils
import
com.ydl.ydlcommon.utils.FileUtils
import
com.yidianling.common.tools.*
import
io.reactivex.Observable
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Consumer
import
io.reactivex.functions.Consumer
...
@@ -46,7 +46,7 @@ class LogHelper private constructor() {
...
@@ -46,7 +46,7 @@ class LogHelper private constructor() {
/**
/**
* 删除过期日志
* 删除过期日志
*/
*/
fun
deleteExpireLog
()
{
private
fun
deleteExpireLog
()
{
val
files
=
getLogFolder
().
listFiles
()
val
files
=
getLogFolder
().
listFiles
()
val
calendar
=
Calendar
.
getInstance
()
val
calendar
=
Calendar
.
getInstance
()
calendar
.
add
(
Calendar
.
WEEK_OF_YEAR
,
-
1
)
calendar
.
add
(
Calendar
.
WEEK_OF_YEAR
,
-
1
)
...
@@ -59,7 +59,9 @@ class LogHelper private constructor() {
...
@@ -59,7 +59,9 @@ class LogHelper private constructor() {
}
}
}
}
@SuppressLint
(
"SimpleDateFormat"
)
private
val
dateFormat
=
SimpleDateFormat
(
"yyyyMMdd"
)
private
val
dateFormat
=
SimpleDateFormat
(
"yyyyMMdd"
)
@SuppressLint
(
"SimpleDateFormat"
)
private
val
format
=
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
)
private
val
format
=
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
)
fun
writeLogSync
(
content
:
String
)
{
fun
writeLogSync
(
content
:
String
)
{
...
@@ -82,7 +84,7 @@ class LogHelper private constructor() {
...
@@ -82,7 +84,7 @@ class LogHelper private constructor() {
val
writer
=
BufferedWriter
(
fileWriter
)
val
writer
=
BufferedWriter
(
fileWriter
)
writer
.
write
(
"""Time:${format.format(Calendar.getInstance().time)}"""
)
writer
.
write
(
"""Time:${format.format(Calendar.getInstance().time)}"""
)
writer
.
newLine
()
writer
.
newLine
()
writer
.
write
(
"UserInfo:uid = ${
ModularServiceManager.getPlatformUserService()?.getUser()?.userId}"
)
writer
.
write
(
"UserInfo:uid = ${ModularServiceManager.getPlatformUserService()?.getUser()?.userId}"
)
writer
.
newLine
()
writer
.
newLine
()
writer
.
write
(
"""Network:${RxNetTool.getNetWorkTypeName(BaseApp.getApp())}"""
)
writer
.
write
(
"""Network:${RxNetTool.getNetWorkTypeName(BaseApp.getApp())}"""
)
writer
.
newLine
()
writer
.
newLine
()
...
@@ -108,25 +110,28 @@ class LogHelper private constructor() {
...
@@ -108,25 +110,28 @@ class LogHelper private constructor() {
}
}
fun
uploadLog
(
showToast
:
Boolean
)
{
@SuppressLint
(
"CheckResult"
)
fun
uploadLog
(
showToast
:
Boolean
)
{
Observable
.
create
<
File
>
{
Observable
.
create
<
File
>
{
it
.
onNext
(
zip
())
it
.
onNext
(
zip
())
it
.
onComplete
()
it
.
onComplete
()
}.
subscribeOn
(
Schedulers
.
io
())
}.
subscribeOn
(
Schedulers
.
io
())
.
flatMap
{
PlatformDataManager
.
getHttp
().
uploadLog
(
.
flatMap
{
PlatformDataManager
.
getHttp
().
uploadLog
(
LogParam
(
LogParam
(
it
it
)
)
)
}
)
}
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
Consumer
{
.
subscribe
(
Consumer
{
if
(
showToast
)
{
if
(
showToast
)
{
ToastUtil
.
toastShort
(
it
.
msg
)
ToastUtil
.
toastShort
(
it
.
msg
)
}
}
Log
.
d
(
"TAG"
,
""
)
Log
.
d
(
"TAG"
,
""
)
},
object
:
ThrowableConsumer
()
{
},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
override
fun
accept
(
msg
:
String
)
{
if
(
showToast
)
{
if
(
showToast
)
{
ToastUtil
.
toastShort
(
msg
)
ToastUtil
.
toastShort
(
msg
)
}
}
Log
.
d
(
"TAG"
,
msg
)
Log
.
d
(
"TAG"
,
msg
)
...
@@ -153,18 +158,18 @@ class LogHelper private constructor() {
...
@@ -153,18 +158,18 @@ class LogHelper private constructor() {
if
(
zipFile
.
exists
())
zipFile
.
delete
()
if
(
zipFile
.
exists
())
zipFile
.
delete
()
zipFile
.
createNewFile
()
zipFile
.
createNewFile
()
if
(
appLog
.
exists
()){
if
(
appLog
.
exists
())
{
files
.
add
(
appLog
)
files
.
add
(
appLog
)
}
}
if
(
yunxinLog
.
exists
()){
if
(
yunxinLog
.
exists
())
{
files
.
add
(
yunxinLog
)
files
.
add
(
yunxinLog
)
}
}
if
(
agoraLog
.
exists
()){
if
(
agoraLog
.
exists
())
{
files
.
add
(
agoraLog
)
files
.
add
(
agoraLog
)
}
}
// ZipUtils.toZip(getLogFolder().absolutePath, FileOutputStream(zipFile), true)
// ZipUtils.toZip(getLogFolder().absolutePath, FileOutputStream(zipFile), true)
ZipUtils
.
toZip
(
files
,
FileOutputStream
(
zipFile
))
ZipUtils
.
toZip
(
files
,
FileOutputStream
(
zipFile
))
return
zipFile
return
zipFile
}
}
...
@@ -213,14 +218,15 @@ class LogHelper private constructor() {
...
@@ -213,14 +218,15 @@ class LogHelper private constructor() {
}
}
//获取云信日志路径
//获取云信日志路径
private
fun
getYunXinLog
(
context
:
Context
):
File
{
private
fun
getYunXinLog
(
context
:
Context
):
File
{
val
yunxin
=
FileUtils
.
getSDDirectory
()
+
"/"
+
context
.
packageName
+
"/nim/log"
val
yunxin
=
FileUtils
.
getSDDirectory
()
+
"/"
+
context
.
packageName
+
"/nim/log"
LogUtil
.
d
(
yunxin
)
LogUtil
.
d
(
yunxin
)
return
File
(
yunxin
)
return
File
(
yunxin
)
}
}
//获取声网日志
//获取声网日志
private
fun
getAgoraLog
(
context
:
Context
):
File
{
private
fun
getAgoraLog
(
context
:
Context
):
File
{
val
agora
=
FileUtils
.
getSDDirectory
()
+
"/"
+
context
.
packageName
+
"/agorasdk.log"
val
agora
=
FileUtils
.
getSDDirectory
()
+
"/"
+
context
.
packageName
+
"/agorasdk.log"
return
File
(
agora
)
return
File
(
agora
)
}
}
...
...
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