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
6760ab4d
Commit
6760ab4d
authored
5 years ago
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取mac地址
parent
905ef045
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
21 deletions
+65
-21
BaiduActionDataBean.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/params/BaiduActionDataBean.kt
+5
-0
DeviceTool.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceTool.java
+0
-0
ActionCountUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/ActionCountUtils.kt
+60
-21
No files found.
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/params/BaiduActionDataBean.kt
View file @
6760ab4d
...
...
@@ -72,6 +72,7 @@ internal class BaiduActionDataBean private constructor(builder: Builder) {
internal
var
androidId
:
String
?
=
""
internal
var
convertParam
:
String
?
=
""
internal
var
uid
:
String
?
=
""
internal
var
mac
:
String
?
=
""
internal
var
channel
:
String
?
=
""
fun
pkname
(
pkname
:
String
=
""
):
Builder
{
...
...
@@ -143,6 +144,10 @@ internal class BaiduActionDataBean private constructor(builder: Builder) {
this
.
uid
=
uid
return
this
}
fun
mac
(
mac
:
String
?
=
""
)
:
Builder
{
this
.
mac
=
mac
return
this
}
fun
channel
(
channel
:
String
?
=
""
)
:
Builder
{
this
.
channel
=
channel
...
...
This diff is collapsed.
Click to expand it.
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceTool.java
View file @
6760ab4d
This diff is collapsed.
Click to expand it.
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/actionutil/ActionCountUtils.kt
View file @
6760ab4d
...
...
@@ -48,16 +48,22 @@ class ActionCountUtils {
count
(
eventName
,
*
sign1
,
urlStr
=
""
,
apiStr
=
""
)
}
fun
countUid
(
eventName
:
String
,
uid
:
String
,
vararg
sign1
:
String
)
{
count
(
eventName
,
*
sign1
,
urlStr
=
""
,
apiStr
=
""
,
uid
=
uid
)
fun
countUid
(
eventName
:
String
,
uid
:
String
,
vararg
sign1
:
String
)
{
count
(
eventName
,
*
sign1
,
urlStr
=
""
,
apiStr
=
""
,
uid
=
uid
)
}
fun
count
(
eventName
:
String
,
vararg
sign1
:
String
,
urlStr
:
String
=
""
,
apiStr
:
String
=
""
,
uid
:
String
=
""
)
{
fun
count
(
eventName
:
String
,
vararg
sign1
:
String
,
urlStr
:
String
=
""
,
apiStr
:
String
=
""
,
uid
:
String
=
""
)
{
var
partId
=
""
var
position
=
""
var
userId
=
uid
if
(
TextUtils
.
isEmpty
(
uid
)){
userId
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
?.
userId
?:
""
if
(
TextUtils
.
isEmpty
(
uid
))
{
userId
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
?.
userId
?:
""
}
if
(
eventName
.
contains
(
"|"
))
{
val
splitList
=
eventName
.
split
(
"|"
)
...
...
@@ -73,11 +79,25 @@ class ActionCountUtils {
/**
* 行为数据埋点调用的方法
*/
fun
count
(
uid
:
String
?,
partId
:
String
,
position
:
String
,
url
:
String
,
api
:
String
,
sign1
:
String
)
{
fun
count
(
uid
:
String
?,
partId
:
String
,
position
:
String
,
url
:
String
,
api
:
String
,
sign1
:
String
)
{
count
(
uid
,
partId
,
position
,
url
,
api
,
signs
=
*
arrayOf
(
sign1
))
}
fun
count
(
uid
:
String
?,
partId
:
String
,
position
:
String
,
url
:
String
,
api
:
String
,
vararg
signs
:
String
)
{
fun
count
(
uid
:
String
?,
partId
:
String
,
position
:
String
,
url
:
String
,
api
:
String
,
vararg
signs
:
String
)
{
try
{
...
...
@@ -140,17 +160,25 @@ class ActionCountUtils {
/**
* 百度检测数据埋点调用的方法
*/
fun
baiduCount
(
partId
:
String
,
position
:
String
,
convertType
:
Int
)
{
fun
baiduCount
(
partId
:
String
,
position
:
String
,
convertType
:
Int
)
{
val
appFrom
=
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
if
(
YDLConstants
.
FROM_YDL
!=
appFrom
){
if
(
YDLConstants
.
FROM_YDL
!=
appFrom
)
{
return
}
val
userId
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
?.
userId
?:
""
baiduCount
(
userId
,
partId
,
position
,
""
,
""
,
convertType
)
val
userId
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
?.
userId
?:
""
baiduCount
(
userId
,
partId
,
position
,
""
,
""
,
convertType
)
}
fun
baiduCount
(
uid
:
String
?,
partId
:
String
,
position
:
String
,
url
:
String
,
api
:
String
,
convertType
:
Int
)
{
var
appId
=
"ydl-app-android-"
+
(
if
(
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
==
YDLConstants
.
FROM_XLZX
)
"xlzx"
else
"user"
)
fun
baiduCount
(
uid
:
String
?,
partId
:
String
,
position
:
String
,
url
:
String
,
api
:
String
,
convertType
:
Int
)
{
var
appId
=
"ydl-app-android-"
+
(
if
(
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
==
YDLConstants
.
FROM_XLZX
)
"xlzx"
else
"user"
)
try
{
val
actionDataParams
=
ActionDataBean
.
Builder
()
...
...
@@ -185,6 +213,16 @@ class ActionCountUtils {
baiduActionDataParams
.
network
(
DeviceTool
.
getNetworkState
(
RxTool
.
getContext
()))
baiduActionDataParams
.
convertParam
(
""
)
baiduActionDataParams
.
uid
(
uid
)
try
{
var
mac
=
DeviceTool
.
getMac
(
BaseApp
.
getApp
())
if
(!
TextUtils
.
isEmpty
(
mac
))
{
mac
=
mac
.
replace
(
":"
,
""
)
}
com
.
ydl
.
ydlcommon
.
utils
.
LogUtil
.
d
(
"MAC=${mac}"
)
baiduActionDataParams
.
mac
(
mac
)
}
catch
(
e
:
Exception
)
{
}
baiduActionDataParams
.
channel
(
YdlCommonOut
.
getChannelName
())
val
gson
=
Gson
().
toJson
(
baiduActionDataParams
)
Log
.
e
(
"Action"
,
"---------$gson"
)
...
...
@@ -206,13 +244,13 @@ class ActionCountUtils {
fun
request
(
actionDataBean
:
ActionDataBean
)
{
try
{
ApiRequestUtil
.
actionDataCount
(
actionDataBean
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
LogUtil
.
i
(
TAG
,
it
.
data
)
})
{
LogUtil
.
i
(
TAG
,
it
.
toString
())
}
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
LogUtil
.
i
(
TAG
,
it
.
data
)
})
{
LogUtil
.
i
(
TAG
,
it
.
toString
())
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
...
...
@@ -289,7 +327,8 @@ class ActionCountUtils {
*/
private
fun
isWifi
():
Boolean
{
try
{
var
connectivityManager
:
ConnectivityManager
=
RxTool
.
getContext
().
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
)
as
ConnectivityManager
var
connectivityManager
:
ConnectivityManager
=
RxTool
.
getContext
().
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
)
as
ConnectivityManager
var
info
:
NetworkInfo
=
connectivityManager
.
activeNetworkInfo
if
(
info
!=
null
&&
info
.
type
==
ConnectivityManager
.
TYPE_WIFI
)
{
return
true
...
...
This diff is collapsed.
Click to expand it.
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