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
Show 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> {
//StoryLogin storyLogin = JSONObject.parseObject(s,StoryLogin.class);
//匹配OpenId
//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
);
//StoryNovelAction对像参数填充
...
...
src/main/java/com/lwby/marketing/controller/DyVideoController.java
View file @
0f00935d
...
...
@@ -9,6 +9,8 @@ import com.lwby.marketing.po.VideoUpload;
import
com.lwby.marketing.util.HttpUtil
;
import
com.lwby.marketing.util.ResultConstant
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
...
@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Objects
;
/**
* @author songxinyu
...
...
@@ -29,6 +32,10 @@ public class DyVideoController {
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
DyVideoUniversalProcess
up
;
...
...
@@ -37,12 +44,14 @@ public class DyVideoController {
Map
map
=
new
HashMap
();
String
result
=
""
;
VideoUpload
videoUpload
=
up
.
get
(
VideoUpload
.
class
,
assembleKey
(
openId
));
if
(
Objects
.
nonNull
(
videoUpload
))
{
Integer
platformId
=
videoUpload
.
getPlatformId
();
String
uploadKey
=
String
.
format
(
"dv_%s_%d_%s"
,
openId
,
platformId
,
videoUpload
.
getMedia
());
if
(
up
.
exists
(
uploadKey
))
{
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_UPED_FAIL
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_UPED_MESSAGE
);
result
=
JSONObject
.
toJSONString
(
map
);
DYVIDEO_SYS_LOG
.
error
(
"DyVideoController uploadBehavoir uped,uploadKey={}"
,
uploadKey
);
return
result
;
}
...
...
@@ -71,14 +80,24 @@ public class DyVideoController {
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
);
}
return
result
;
}
catch
(
Exception
e
)
{
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_FAIL
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_FAIL_MESSAGE
);
result
=
JSONObject
.
toJSONString
(
map
)
;
DYVIDEO_ERROR_LOG
.
error
(
"DyVideoController uploadBehavoir exception,uploadKey={}"
,
uploadKey
,
e
);
return
result
;
}
}
else
{
map
.
put
(
"code"
,
ResultConstant
.
CALL_BACK_NOCACHE_FAIL
);
map
.
put
(
"message"
,
ResultConstant
.
CALL_BACK_NOCACHE_MESSAGE
);
result
=
JSONObject
.
toJSONString
(
map
)
;
DYVIDEO_SYS_LOG
.
error
(
"DyVideoController uploadBehavoir no cache,videoUpload={}"
,
JSONObject
.
toJSONString
(
videoUpload
));
}
return
result
;
}
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 {
try
{
String
result
=
HttpUtil
.
post
(
ATTRIBUTE_URL
,
userJson
);
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
;
}
catch
(
Exception
e
)
{
return
false
;
...
...
src/main/java/com/lwby/marketing/util/ResultConstant.java
View file @
0f00935d
...
...
@@ -5,10 +5,12 @@ public class ResultConstant {
public
final
static
Integer
CALL_BACK_SUCCESS
=
0
;
public
final
static
Integer
CALL_BACK_FAIL
=
1
;
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_FAIL_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