Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
marketing
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
dingjy
marketing
Commits
d0c6a4a9
Commit
d0c6a4a9
authored
Apr 12, 2024
by
dingjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
ce34daaa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
13 deletions
+35
-13
ClickbackService.java
.../java/com/lwby/marketing/controller/ClickbackService.java
+7
-13
ServiceHelper.java
...ain/java/com/lwby/marketing/controller/ServiceHelper.java
+28
-0
No files found.
src/main/java/com/lwby/marketing/controller/ClickbackService.java
View file @
d0c6a4a9
...
...
@@ -31,7 +31,7 @@ import java.util.function.Function;
@RestController
@Slf4j
@RequestMapping
(
value
=
"/clickback"
)
public
class
ClickbackService
{
public
class
ClickbackService
extends
ServiceHelper
{
final
static
ImmutableSet
<
String
>
filter
=
ImmutableSet
.
of
(
"click.special.param:00000000-0000-0000-0000-000000000000"
,
"9f89c84a559f573636a47ff8daed0d33"
,
"__IMEI__"
,
"null"
,
"NULL"
);
...
...
@@ -77,12 +77,7 @@ public class ClickbackService {
clientInfo
.
setIdfa
(
params
.
get
(
"idfa"
));
clientInfo
.
setClientIp
(
params
.
get
(
"ip"
));
clientInfo
.
setUa
(
params
.
get
(
"ua"
));
try
{
clientInfo
.
setPhoneModel
(
StringUtils
.
defaultIfEmpty
(
URLEncoder
.
encode
(
params
.
get
(
"model"
),
"utf-8"
),
null
));
}
catch
(
UnsupportedEncodingException
e
)
{
throw
new
RuntimeException
(
e
);
}
clientInfo
.
setPhoneModel
(
encode
(
params
.
get
(
"model"
)));
DeliveryDeviceInfo
deliveryDeviceInfo
=
new
DeliveryDeviceInfo
();
deliveryDeviceInfo
.
setClick_time
(
System
.
currentTimeMillis
());
deliveryDeviceInfo
.
setAd_group_id
(
params
.
get
(
"campaign_id"
));
...
...
@@ -104,16 +99,15 @@ public class ClickbackService {
deliveryDeviceInfo
.
setUnion_site
(
params
.
get
(
"union_site"
));
deliveryDeviceInfo
.
setPartId
(
params
.
get
(
"part_id"
));
//巨量广告体验版中特有的宏参,代表巨量广告体验版的广告ID
deliveryDeviceInfo
.
setPromotion_id
(
StringUtils
.
defaultIfEmpty
(
params
.
get
(
"promotion_id"
),
null
));
deliveryDeviceInfo
.
setPromotion_id
(
emptyIsNull
(
params
.
get
(
"promotion_id"
)
));
//巨量广告体验版中特有的宏参,代表巨量广告体验版的项目ID
deliveryDeviceInfo
.
setProject_id
(
StringUtils
.
defaultIfEmpty
(
params
.
get
(
"project_id"
),
null
));
deliveryDeviceInfo
.
setProject_id
(
emptyIsNull
(
params
.
get
(
"project_id"
)
));
//巨量广告体验版中的广告名称
deliveryDeviceInfo
.
setPromotion_name
(
StringUtils
.
defaultIfEmpty
(
params
.
get
(
"promotion_name"
),
null
));
deliveryDeviceInfo
.
setPromotion_name
(
emptyIsNull
(
params
.
get
(
"promotion_name"
)
));
//巨量广告体验版中的项目名称
deliveryDeviceInfo
.
setProject_name
(
StringUtils
.
defaultIfEmpty
(
params
.
get
(
"project_name"
),
null
));
deliveryDeviceInfo
.
setProject_name
(
emptyIsNull
(
params
.
get
(
"project_name"
)
));
//信息流投放广告来源(碎片 1 书籍 2)
deliveryDeviceInfo
.
setSource
(
Integer
.
valueOf
(
params
.
get
(
"source"
)));
deliveryDeviceInfo
.
setSource
(
parseInt
(
params
.
get
(
"source"
)));
return
new
NovelAction
(
clientInfo
,
deliveryDeviceInfo
);
}
...
...
src/main/java/com/lwby/marketing/controller/ServiceHelper.java
0 → 100644
View file @
d0c6a4a9
package
com
.
lwby
.
marketing
.
controller
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
public
class
ServiceHelper
{
public
String
emptyIsNull
(
String
params
){
return
StringUtils
.
defaultIfEmpty
(
params
,
null
);
}
public
String
encode
(
String
params
){
try
{
return
URLEncoder
.
encode
(
params
,
"utf-8"
);
}
catch
(
UnsupportedEncodingException
e
)
{
return
null
;
}
}
public
Integer
parseInt
(
String
params
){
try
{
return
Integer
.
valueOf
(
params
);
}
catch
(
Exception
e
){
return
null
;
}
}
}
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