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
Jan 10, 2020
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取mac地址
parent
905ef045
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
14 deletions
+58
-14
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
+53
-14
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) {
...
@@ -72,6 +72,7 @@ internal class BaiduActionDataBean private constructor(builder: Builder) {
internal
var
androidId
:
String
?
=
""
internal
var
androidId
:
String
?
=
""
internal
var
convertParam
:
String
?
=
""
internal
var
convertParam
:
String
?
=
""
internal
var
uid
:
String
?
=
""
internal
var
uid
:
String
?
=
""
internal
var
mac
:
String
?
=
""
internal
var
channel
:
String
?
=
""
internal
var
channel
:
String
?
=
""
fun
pkname
(
pkname
:
String
=
""
):
Builder
{
fun
pkname
(
pkname
:
String
=
""
):
Builder
{
...
@@ -143,6 +144,10 @@ internal class BaiduActionDataBean private constructor(builder: Builder) {
...
@@ -143,6 +144,10 @@ internal class BaiduActionDataBean private constructor(builder: Builder) {
this
.
uid
=
uid
this
.
uid
=
uid
return
this
return
this
}
}
fun
mac
(
mac
:
String
?
=
""
)
:
Builder
{
this
.
mac
=
mac
return
this
}
fun
channel
(
channel
:
String
?
=
""
)
:
Builder
{
fun
channel
(
channel
:
String
?
=
""
)
:
Builder
{
this
.
channel
=
channel
this
.
channel
=
channel
...
...
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 {
...
@@ -48,16 +48,22 @@ class ActionCountUtils {
count
(
eventName
,
*
sign1
,
urlStr
=
""
,
apiStr
=
""
)
count
(
eventName
,
*
sign1
,
urlStr
=
""
,
apiStr
=
""
)
}
}
fun
countUid
(
eventName
:
String
,
uid
:
String
,
vararg
sign1
:
String
)
{
fun
countUid
(
eventName
:
String
,
uid
:
String
,
vararg
sign1
:
String
)
{
count
(
eventName
,
*
sign1
,
urlStr
=
""
,
apiStr
=
""
,
uid
=
uid
)
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
partId
=
""
var
position
=
""
var
position
=
""
var
userId
=
uid
var
userId
=
uid
if
(
TextUtils
.
isEmpty
(
uid
)){
if
(
TextUtils
.
isEmpty
(
uid
))
{
userId
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
?.
userId
?:
""
userId
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
?.
userId
?:
""
}
}
if
(
eventName
.
contains
(
"|"
))
{
if
(
eventName
.
contains
(
"|"
))
{
val
splitList
=
eventName
.
split
(
"|"
)
val
splitList
=
eventName
.
split
(
"|"
)
...
@@ -73,11 +79,25 @@ class ActionCountUtils {
...
@@ -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
))
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
{
try
{
...
@@ -140,17 +160,25 @@ class ActionCountUtils {
...
@@ -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
val
appFrom
=
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
if
(
YDLConstants
.
FROM_YDL
!=
appFrom
){
if
(
YDLConstants
.
FROM_YDL
!=
appFrom
)
{
return
return
}
}
val
userId
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
?.
userId
?:
""
val
userId
=
ModularServiceManager
.
getPlatformUserService
()
?.
getUser
()
?.
userId
?:
""
baiduCount
(
userId
,
partId
,
position
,
""
,
""
,
convertType
)
baiduCount
(
userId
,
partId
,
position
,
""
,
""
,
convertType
)
}
}
fun
baiduCount
(
uid
:
String
?,
partId
:
String
,
position
:
String
,
url
:
String
,
api
:
String
,
convertType
:
Int
)
{
fun
baiduCount
(
var
appId
=
"ydl-app-android-"
+
(
if
(
BaseApp
.
instance
.
getGlobalConfig
().
appFrom
==
YDLConstants
.
FROM_XLZX
)
"xlzx"
else
"user"
)
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
{
try
{
val
actionDataParams
=
ActionDataBean
.
Builder
()
val
actionDataParams
=
ActionDataBean
.
Builder
()
...
@@ -185,6 +213,16 @@ class ActionCountUtils {
...
@@ -185,6 +213,16 @@ class ActionCountUtils {
baiduActionDataParams
.
network
(
DeviceTool
.
getNetworkState
(
RxTool
.
getContext
()))
baiduActionDataParams
.
network
(
DeviceTool
.
getNetworkState
(
RxTool
.
getContext
()))
baiduActionDataParams
.
convertParam
(
""
)
baiduActionDataParams
.
convertParam
(
""
)
baiduActionDataParams
.
uid
(
uid
)
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
())
baiduActionDataParams
.
channel
(
YdlCommonOut
.
getChannelName
())
val
gson
=
Gson
().
toJson
(
baiduActionDataParams
)
val
gson
=
Gson
().
toJson
(
baiduActionDataParams
)
Log
.
e
(
"Action"
,
"---------$gson"
)
Log
.
e
(
"Action"
,
"---------$gson"
)
...
@@ -289,7 +327,8 @@ class ActionCountUtils {
...
@@ -289,7 +327,8 @@ class ActionCountUtils {
*/
*/
private
fun
isWifi
():
Boolean
{
private
fun
isWifi
():
Boolean
{
try
{
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
var
info
:
NetworkInfo
=
connectivityManager
.
activeNetworkInfo
if
(
info
!=
null
&&
info
.
type
==
ConnectivityManager
.
TYPE_WIFI
)
{
if
(
info
!=
null
&&
info
.
type
==
ConnectivityManager
.
TYPE_WIFI
)
{
return
true
return
true
...
...
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