Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
fanxing3
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6a45cc04
authored
Jan 21, 2022
by
xmh
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
<feat> 推送成功后打印日志
1 parent
c142d2fc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
fanxing-forward/src/main/java/com/viontech/fanxing/forward/batch/writer/ForwardWriter.java
fanxing-forward/src/main/java/com/viontech/fanxing/forward/controller/DataReceiveController.java
fanxing-forward/src/main/java/com/viontech/fanxing/forward/batch/writer/ForwardWriter.java
View file @
6a45cc0
...
...
@@ -67,6 +67,7 @@ public class ForwardWriter implements ItemWriter<ForwardContent> {
.
retrieve
()
.
bodyToMono
(
String
.
class
);
String
block
=
response
.
block
(
Duration
.
ofSeconds
(
20
));
log
.
info
(
"数据推送完成,对接名称:[{}],结果:[{}]"
,
forward
.
getName
(),
block
);
}
catch
(
Exception
e
)
{
failed
+=
1
;
if
(
failed
==
3
)
{
...
...
fanxing-forward/src/main/java/com/viontech/fanxing/forward/controller/DataReceiveController.java
View file @
6a45cc0
...
...
@@ -101,16 +101,9 @@ public class DataReceiveController {
param
.
add
(
"refid"
,
videoResult
.
getRefid
());
param
.
add
(
"format"
,
videoResult
.
getFormat
());
param
.
add
(
"file"
,
new
FileSystemResource
(
file
));
Mono
<
String
>
response
=
WebClientUtils
.
buildClient
(
null
)
.
post
()
.
uri
(
forward
.
getUrl
())
.
contentType
(
MediaType
.
MULTIPART_FORM_DATA
)
.
contentLength
(
file
.
length
())
.
body
(
BodyInserters
.
fromMultipartData
(
param
))
.
retrieve
()
.
bodyToMono
(
String
.
class
);
Mono
<
String
>
response
=
WebClientUtils
.
buildClient
(
null
).
post
().
uri
(
forward
.
getUrl
()).
contentType
(
MediaType
.
MULTIPART_FORM_DATA
).
contentLength
(
file
.
length
()).
body
(
BodyInserters
.
fromMultipartData
(
param
)).
retrieve
().
bodyToMono
(
String
.
class
);
String
block
=
response
.
block
(
Duration
.
ofSeconds
(
10
));
log
.
info
(
"发送视频文件完成,
结果:{}"
,
block
);
log
.
info
(
"发送视频文件完成,
对接名称:[{}],结果:[{}]"
,
forward
.
getName
()
,
block
);
}
catch
(
Exception
e
)
{
log
.
error
(
"发送视频文件失败"
,
e
);
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment