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
ba1f79fd
Commit
ba1f79fd
authored
Apr 25, 2024
by
宋新宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
还原
parent
8cb6e6d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
127 deletions
+10
-127
ClickbackService.java
.../java/com/lwby/marketing/controller/ClickbackService.java
+10
-127
No files found.
src/main/java/com/lwby/marketing/controller/ClickbackService.java
View file @
ba1f79fd
...
...
@@ -23,10 +23,12 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.UUID
;
import
java.util.concurrent.TimeUnit
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -52,129 +54,10 @@ public class ClickbackService extends ServiceHelper{
private
static
final
String
UASUF
=
" like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
;
@RequestMapping
(
"/jrtt"
)
@ResponseBody
public
Object
jrttClick
(
HttpServletRequest
request
){
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
Enumeration
<
String
>
en
=
request
.
getParameterNames
();
while
(
en
.
hasMoreElements
()){
String
key
=
en
.
nextElement
();
params
.
put
(
key
,
request
.
getParameter
(
key
));
}
NovelAction
action
=
fullJrtt
(
params
);
for
(
DeviceType
type:
DeviceType
.
values
()){
String
deviceIdKey
=
type
.
getDeviceId
(
action
.
getClientInfo
());
if
(
null
!=
deviceIdKey
){
DeliveryDeviceInfo
ddi
=
action
.
getDeliveryDeviceInfo
();
if
(
StringUtils
.
isNotEmpty
(
ddi
.
getDj_channel
()))
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getChannelByDeviceIdKeyAndPlatformId
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
Integer
.
parseInt
(
ddi
.
getDj_channel
())),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
if
(
StringUtils
.
isNumeric
(
ddi
.
getBook_id
()))
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getDeliveryBookIdCacheKey
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
.
getBook_id
()),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
if
(
StringUtils
.
isNumeric
(
ddi
.
getPartId
()))
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getDeliveryPartIdCacheKey
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
.
getPartId
()),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
}
}
}
if
(
type
==
DeviceType
.
IP
)
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getClickKey
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
}
else
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getClickKeyByIdfaAndPlatformId
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
}
}
}
log
.
info
(
"jrttClick param succ,params={}"
,
JSON
.
toJSONString
(
params
));
return
RESULT_SUCCESS
;
}
@RequestMapping
(
"/weChat"
)
@ResponseBody
public
Object
weChatClick
(
HttpServletRequest
request
){
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
Enumeration
<
String
>
en
=
request
.
getParameterNames
();
while
(
en
.
hasMoreElements
()){
String
key
=
en
.
nextElement
();
params
.
put
(
key
,
request
.
getParameter
(
key
));
}
NovelAction
action
=
fullWeChat
(
params
);
for
(
DeviceType
type:
DeviceType
.
values
()){
String
deviceIdKey
=
type
.
getDeviceId
(
action
.
getClientInfo
());
if
(
null
!=
deviceIdKey
){
DeliveryDeviceInfo
ddi
=
action
.
getDeliveryDeviceInfo
();
if
(
StringUtils
.
isNotEmpty
(
ddi
.
getDj_channel
()))
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getChannelByDeviceIdKeyAndPlatformId
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
Integer
.
parseInt
(
ddi
.
getDj_channel
())),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
if
(
StringUtils
.
isNumeric
(
ddi
.
getBook_id
()))
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getDeliveryBookIdCacheKey
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
.
getBook_id
()),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
if
(
StringUtils
.
isNumeric
(
ddi
.
getPartId
()))
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getDeliveryPartIdCacheKey
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
.
getPartId
()),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
}
}
}
if
(
type
==
DeviceType
.
IP
)
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getClickKey
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
}
else
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getClickKeyByIdfaAndPlatformId
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
}
}
}
log
.
info
(
"wechatClick param succ,params={}"
,
JSON
.
toJSONString
(
params
));
return
RESULT_SUCCESS
;
}
@RequestMapping
(
"/jrttFreeVideo"
)
@ResponseBody
public
Object
jrttFreeVideoClick
(
HttpServletRequest
request
){
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
Enumeration
<
String
>
en
=
request
.
getParameterNames
();
while
(
en
.
hasMoreElements
()){
String
key
=
en
.
nextElement
();
params
.
put
(
key
,
request
.
getParameter
(
key
));
}
NovelAction
action
=
fullJrttFreeVideo
(
params
);
for
(
DeviceVideoType
type:
DeviceVideoType
.
values
()){
String
deviceIdKey
=
type
.
getDeviceId
(
action
.
getClientInfo
());
if
(
null
!=
deviceIdKey
){
DeliveryDeviceInfo
ddi
=
action
.
getDeliveryDeviceInfo
();
if
(
StringUtils
.
isNotEmpty
(
ddi
.
getDj_channel
()))
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getChannelByDeviceIdKeyAndPlatformId
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
Integer
.
parseInt
(
ddi
.
getDj_channel
())),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
if
(
StringUtils
.
isNumeric
(
ddi
.
getVideoResourceId
()))
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getDeliveryVRIdCacheKey
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
.
getVideoResourceId
()),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
if
(
StringUtils
.
isNumeric
(
ddi
.
getVideoId
()))
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getDeliveryVIIdCacheKey
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
.
getVideoId
()),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
}
}
}
if
(
type
==
DeviceVideoType
.
IDFA
)
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getClickKey
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
}
else
{
redisTemplate
.
opsForValue
().
set
(
CacheKeyUtils
.
getClickKeyByIdfaAndPlatformId
(
deviceIdKey
,
ddi
.
getPlatform_id
()),
JSON
.
toJSONString
(
ddi
),
bookIdExpireTime
,
TimeUnit
.
SECONDS
);
}
}
}
log
.
info
(
"jrttFreeVideoClick param succ,params={}"
,
JSON
.
toJSONString
(
params
));
return
RESULT_SUCCESS
;
}
@RequestMapping
(
"/mediaJrtt"
)
@RequestMapping
(
"/jrtt"
)
@ResponseBody
public
Object
jrtt
Media
Click
(
@RequestParam
Map
<
String
,
String
>
params
){
public
Object
jrttClick
(
@RequestParam
Map
<
String
,
String
>
params
){
NovelAction
action
=
fullJrtt
(
params
);
for
(
DeviceType
type:
DeviceType
.
values
()){
...
...
@@ -205,9 +88,9 @@ public class ClickbackService extends ServiceHelper{
return
RESULT_SUCCESS
;
}
@RequestMapping
(
"/
mediaW
eChat"
)
@RequestMapping
(
"/
w
eChat"
)
@ResponseBody
public
Object
wechat
Media
Click
(
@RequestParam
Map
<
String
,
String
>
params
){
public
Object
wechatClick
(
@RequestParam
Map
<
String
,
String
>
params
){
NovelAction
action
=
fullWeChat
(
params
);
for
(
DeviceType
type:
DeviceType
.
values
()){
...
...
@@ -237,9 +120,9 @@ public class ClickbackService extends ServiceHelper{
return
RESULT_SUCCESS
;
}
@RequestMapping
(
"/
mediaJ
rttFreeVideo"
)
@RequestMapping
(
"/
j
rttFreeVideo"
)
@ResponseBody
public
Object
jrttFreeVideo
Media
Click
(
@RequestParam
Map
<
String
,
String
>
params
){
public
Object
jrttFreeVideoClick
(
@RequestParam
Map
<
String
,
String
>
params
){
NovelAction
action
=
fullJrttFreeVideo
(
params
);
for
(
DeviceVideoType
type:
DeviceVideoType
.
values
()){
...
...
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