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
0f00935d
Commit
0f00935d
authored
Apr 11, 2024
by
宋新宇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '8-抖小更改' into 'release_20240411'
抖小更改及监测 See merge request
!46
parents
c78b83d6
ca88cc4c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
33 deletions
+54
-33
ParameterSetupDyVideoFlow.java
...rketing/att/dyvideo/handle/ParameterSetupDyVideoFlow.java
+1
-1
DyVideoController.java
...java/com/lwby/marketing/controller/DyVideoController.java
+50
-31
DyVideoJRTTNotify.java
...m/lwby/marketing/notify/media/jrtt/DyVideoJRTTNotify.java
+1
-1
ResultConstant.java
src/main/java/com/lwby/marketing/util/ResultConstant.java
+2
-0
No files found.
src/main/java/com/lwby/marketing/att/dyvideo/handle/ParameterSetupDyVideoFlow.java
View file @
0f00935d
...
@@ -38,7 +38,7 @@ public class ParameterSetupDyVideoFlow extends NodeFlow<StoryNovelAction> {
...
@@ -38,7 +38,7 @@ public class ParameterSetupDyVideoFlow extends NodeFlow<StoryNovelAction> {
//StoryLogin storyLogin = JSONObject.parseObject(s,StoryLogin.class);
//StoryLogin storyLogin = JSONObject.parseObject(s,StoryLogin.class);
//匹配OpenId
//匹配OpenId
//VideoUpload videoUpload = JSONObject.parseObject(s,VideoUpload.class);
//VideoUpload videoUpload = JSONObject.parseObject(s,VideoUpload.class);
VideoUpload
videoUpload
=
up
.
get
Old
(
VideoUpload
.
class
,
assembleKey
(
openId
));
VideoUpload
videoUpload
=
up
.
get
(
VideoUpload
.
class
,
assembleKey
(
openId
));
action
.
setVideoUpload
(
videoUpload
);
action
.
setVideoUpload
(
videoUpload
);
//StoryNovelAction对像参数填充
//StoryNovelAction对像参数填充
...
...
src/main/java/com/lwby/marketing/controller/DyVideoController.java
View file @
0f00935d
...
@@ -9,6 +9,8 @@ import com.lwby.marketing.po.VideoUpload;
...
@@ -9,6 +9,8 @@ import com.lwby.marketing.po.VideoUpload;
import
com.lwby.marketing.util.HttpUtil
;
import
com.lwby.marketing.util.HttpUtil
;
import
com.lwby.marketing.util.ResultConstant
;
import
com.lwby.marketing.util.ResultConstant
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
/**
/**
* @author songxinyu
* @author songxinyu
...
@@ -29,6 +32,10 @@ public class DyVideoController {
...
@@ -29,6 +32,10 @@ public class DyVideoController {
public
static
final
String
ATTRIBUTE_URL
=
"https://analytics.oceanengine.com/api/v2/conversion"
;
public
static
final
String
ATTRIBUTE_URL
=
"https://analytics.oceanengine.com/api/v2/conversion"
;
private
static
final
Logger
DYVIDEO_SYS_LOG
=
LoggerFactory
.
getLogger
(
"dyvideo.sys"
);
private
static
final
Logger
DYVIDEO_ERROR_LOG
=
LoggerFactory
.
getLogger
(
"dyvideo.error"
);
@Resource
@Resource
DyVideoUniversalProcess
up
;
DyVideoUniversalProcess
up
;
...
@@ -37,48 +44,60 @@ public class DyVideoController {
...
@@ -37,48 +44,60 @@ public class DyVideoController {
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
String
result
=
""
;
String
result
=
""
;
VideoUpload
videoUpload
=
up
.
get
(
VideoUpload
.
class
,
assembleKey
(
openId
));
VideoUpload
videoUpload
=
up
.
get
(
VideoUpload
.
class
,
assembleKey
(
openId
));
Integer
platformId
=
videoUpload
.
getPlatformId
();
if
(
Objects
.
nonNull
(
videoUpload
))
{
String
uploadKey
=
String
.
format
(
"dv_%s_%d_%s"
,
openId
,
platformId
,
videoUpload
.
getMedia
());
Integer
platformId
=
videoUpload
.
getPlatformId
();
if
(
up
.
exists
(
uploadKey
))
{
String
uploadKey
=
String
.
format
(
"dv_%s_%d_%s"
,
openId
,
platformId
,
videoUpload
.
getMedia
());
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_UPED_FAIL
);
if
(
up
.
exists
(
uploadKey
))
{
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_UPED_MESSAGE
);
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_UPED_FAIL
);
result
=
JSONObject
.
toJSONString
(
map
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_UPED_MESSAGE
);
return
result
;
result
=
JSONObject
.
toJSONString
(
map
);
}
DYVIDEO_SYS_LOG
.
error
(
"DyVideoController uploadBehavoir uped,uploadKey={}"
,
uploadKey
);
return
result
;
}
JrttAttributeRequest
.
Ad
ad
=
new
JrttAttributeRequest
.
Ad
();
JrttAttributeRequest
.
Ad
ad
=
new
JrttAttributeRequest
.
Ad
();
ad
.
setCallback
(
videoUpload
.
getClickId
());
ad
.
setCallback
(
videoUpload
.
getClickId
());
JrttAttributeRequest
.
Context
context
=
new
JrttAttributeRequest
.
Context
();
JrttAttributeRequest
.
Context
context
=
new
JrttAttributeRequest
.
Context
();
context
.
setAd
(
ad
);
context
.
setAd
(
ad
);
JrttAttributeRequest
request
=
JrttAttributeRequest
.
builder
().
context
(
context
).
event_type
(
"game_addiction"
).
timestamp
(
JrttAttributeRequest
request
=
JrttAttributeRequest
.
builder
().
context
(
context
).
event_type
(
"game_addiction"
).
timestamp
(
System
.
currentTimeMillis
()).
build
();
System
.
currentTimeMillis
()).
build
();
String
userJson
=
JSONObject
.
toJSONString
(
request
);
String
userJson
=
JSONObject
.
toJSONString
(
request
);
try
{
try
{
String
ret
=
HttpUtil
.
post
(
ATTRIBUTE_URL
,
userJson
);
String
ret
=
HttpUtil
.
post
(
ATTRIBUTE_URL
,
userJson
);
Integer
resultCode
=
(
Integer
)
JSON
.
parseObject
(
ret
).
get
(
"code"
);
Integer
resultCode
=
(
Integer
)
JSON
.
parseObject
(
ret
).
get
(
"code"
);
if
(
resultCode
==
0
)
{
if
(
resultCode
==
0
)
{
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_SUCCESS
);
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_SUCCESS
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_SUCCESS_MESSAGE
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_SUCCESS_MESSAGE
);
result
=
JSONObject
.
toJSONString
(
map
)
;
result
=
JSONObject
.
toJSONString
(
map
)
;
//给bi发消息
//给bi发消息
up
.
notifyResult
(
openId
,
videoUpload
);
up
.
notifyResult
(
openId
,
videoUpload
);
up
.
set
(
uploadKey
,
60
*
60
*
24
*
7
,
"1"
);
up
.
set
(
uploadKey
,
60
*
60
*
24
*
7
,
"1"
);
}
else
{
}
else
{
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_FAIL
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_FAIL_MESSAGE
);
result
=
JSONObject
.
toJSONString
(
map
)
;
DYVIDEO_SYS_LOG
.
error
(
"DyVideoController uploadBehavoir send back fail,uploadKey={},code={}"
,
uploadKey
,
resultCode
);
}
}
catch
(
Exception
e
)
{
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_FAIL
);
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_FAIL
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_FAIL_MESSAGE
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_FAIL_MESSAGE
);
result
=
JSONObject
.
toJSONString
(
map
)
;
result
=
JSONObject
.
toJSONString
(
map
)
;
DYVIDEO_ERROR_LOG
.
error
(
"DyVideoController uploadBehavoir exception,uploadKey={}"
,
uploadKey
,
e
);
return
result
;
}
}
return
result
;
}
else
{
}
catch
(
Exception
e
)
{
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_NOCACHE_FAIL
);
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_FAIL
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_NOCACHE_MESSAGE
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_FAIL_MESSAGE
);
result
=
JSONObject
.
toJSONString
(
map
)
;
result
=
JSONObject
.
toJSONString
(
map
)
;
return
result
;
DYVIDEO_SYS_LOG
.
error
(
"DyVideoController uploadBehavoir no cache,videoUpload={}"
,
JSONObject
.
toJSONString
(
videoUpload
))
;
}
}
return
result
;
}
}
public
String
assembleKey
(
String
openId
)
{
public
String
assembleKey
(
String
openId
)
{
...
...
src/main/java/com/lwby/marketing/notify/media/jrtt/DyVideoJRTTNotify.java
View file @
0f00935d
...
@@ -48,7 +48,7 @@ public class DyVideoJRTTNotify extends DYNotify {
...
@@ -48,7 +48,7 @@ public class DyVideoJRTTNotify extends DYNotify {
try
{
try
{
String
result
=
HttpUtil
.
post
(
ATTRIBUTE_URL
,
userJson
);
String
result
=
HttpUtil
.
post
(
ATTRIBUTE_URL
,
userJson
);
Integer
resultCode
=
(
Integer
)
JSON
.
parseObject
(
result
).
get
(
"code"
);
Integer
resultCode
=
(
Integer
)
JSON
.
parseObject
(
result
).
get
(
"code"
);
DYVIDEO_SYS_LOG
.
info
(
"DyVideoJRTTNotify.video.{}.upload,userId={},channel={},platform={}
"
,
eventType
,
na
.
getUserId
(),
na
.
getChannelId
(),
na
.
getPlatformId
()
);
DYVIDEO_SYS_LOG
.
info
(
"DyVideoJRTTNotify.video.{}.upload,userId={},channel={},platform={}
,code={}"
,
eventType
,
na
.
getUserId
(),
na
.
getChannelId
(),
na
.
getPlatformId
(),
resultCode
);
return
resultCode
==
0
;
return
resultCode
==
0
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
false
;
return
false
;
...
...
src/main/java/com/lwby/marketing/util/ResultConstant.java
View file @
0f00935d
...
@@ -5,10 +5,12 @@ public class ResultConstant {
...
@@ -5,10 +5,12 @@ public class ResultConstant {
public
final
static
Integer
CALL_BACK_SUCCESS
=
0
;
public
final
static
Integer
CALL_BACK_SUCCESS
=
0
;
public
final
static
Integer
CALL_BACK_FAIL
=
1
;
public
final
static
Integer
CALL_BACK_FAIL
=
1
;
public
final
static
Integer
CALL_BACK_UPED_FAIL
=
2
;
public
final
static
Integer
CALL_BACK_UPED_FAIL
=
2
;
public
final
static
Integer
CALL_BACK_NOCACHE_FAIL
=
3
;
public
final
static
String
CALL_BACK_SUCCESS_MESSAGE
=
"上报成功"
;
public
final
static
String
CALL_BACK_SUCCESS_MESSAGE
=
"上报成功"
;
public
final
static
String
CALL_BACK_FAIL_MESSAGE
=
"上报失败"
;
public
final
static
String
CALL_BACK_FAIL_MESSAGE
=
"上报失败"
;
public
final
static
String
CALL_BACK_UPED_MESSAGE
=
"已上报一次"
;
public
final
static
String
CALL_BACK_UPED_MESSAGE
=
"已上报一次"
;
public
final
static
String
CALL_BACK_NOCACHE_MESSAGE
=
"无点击缓存,用户超过7天"
;
}
}
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