Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
D
data-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
licc
data-server
Commits
c3efd540
Commit
c3efd540
authored
Mar 10, 2021
by
m1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资讯模块数据——视频功能修复
parent
08137cef
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
216 additions
and
10 deletions
+216
-10
UploadServiceImpl.java
...java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
+9
-10
wisenergy-service.iml
wisenergy-service/wisenergy-service.iml
+207
-0
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
View file @
c3efd540
...
@@ -52,17 +52,11 @@ public class UploadServiceImpl implements UploadService {
...
@@ -52,17 +52,11 @@ public class UploadServiceImpl implements UploadService {
@Override
@Override
public
Map
<
String
,
Object
>
uploadVideo
(
MultipartFile
file
,
HttpServletRequest
request
,
String
zxField
,
String
zxAddress
,
String
inviteCode
)
throws
Exception
{
public
Map
<
String
,
Object
>
uploadVideo
(
MultipartFile
file
,
HttpServletRequest
request
,
String
zxField
,
String
zxAddress
,
String
inviteCode
)
throws
Exception
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<
String
,
Object
>();
/**
* 生成当前时间戳
*/
BigInteger
zxDate
=
BigInteger
.
valueOf
(
System
.
currentTimeMillis
());
/**
/**
* http://路径
* http://路径
*/
*/
String
basePath
=
request
.
getScheme
()
+
"://"
+
request
.
getServerName
()
String
basePath
=
request
.
getScheme
()
+
"://"
+
request
.
getServerName
()
+
":"
+
request
.
getServerPort
()+
"/upload/video/"
;
+
":"
+
request
.
getServerPort
()+
"/upload/video/"
;
Long
time
=
new
Date
().
getTime
();
Long
time
=
new
Date
().
getTime
();
String
fileName
=
file
.
getOriginalFilename
();
//文件原始名称
String
fileName
=
file
.
getOriginalFilename
();
//文件原始名称
...
@@ -82,19 +76,24 @@ public class UploadServiceImpl implements UploadService {
...
@@ -82,19 +76,24 @@ public class UploadServiceImpl implements UploadService {
//将内存中的数据写入磁盘
//将内存中的数据写入磁盘
file
.
transferTo
(
newFile
);
file
.
transferTo
(
newFile
);
//视频上传保存url
//视频上传保存url
String
zx
Url
=
basePath
+
newFileName
;
String
video
Url
=
basePath
+
newFileName
;
//视频封面图处理
//视频封面图处理
String
newImgName
=
time
+
".jpg"
;
String
newImgName
=
time
+
".jpg"
;
String
framefile
=
rootPath
+
newImgName
;
String
framefile
=
rootPath
+
newImgName
;
String
imgUrlSave
=
basePath
+
newImgName
;
//图片最终位置路径
String
imgUrlSave
=
basePath
+
newImgName
;
//图片最终位置路径
//视频截取封面图
//视频截取封面图
String
imgUrl
=
FrameGrabberKit
.
getVedioImg
(
zx
Url
,
framefile
,
imgUrlSave
);
String
imgUrl
=
FrameGrabberKit
.
getVedioImg
(
video
Url
,
framefile
,
imgUrlSave
);
resultMap
.
put
(
"
zxUrl"
,
zx
Url
);
resultMap
.
put
(
"
videoUrl"
,
video
Url
);
resultMap
.
put
(
"imgUrl"
,
imgUrl
);
resultMap
.
put
(
"imgUrl"
,
imgUrl
);
resultMap
.
put
(
"returnCode"
,
0
);
resultMap
.
put
(
"returnCode"
,
200
);
String
zxUrl
=
videoUrl
;
//System.out.println("上传的文件名为:"+fileName+",后缀名为:"+newFileName);
//System.out.println("上传的文件名为:"+fileName+",后缀名为:"+newFileName);
/**
* 生成当前时间戳
*/
BigInteger
zxDate
=
BigInteger
.
valueOf
(
System
.
currentTimeMillis
());
shopZxMapper
.
zxadd
(
zxUrl
,
zxField
,
zxAddress
,
inviteCode
,
String
.
valueOf
(
zxDate
));
shopZxMapper
.
zxadd
(
zxUrl
,
zxField
,
zxAddress
,
inviteCode
,
String
.
valueOf
(
zxDate
));
return
resultMap
;
return
resultMap
;
}
}
...
...
wisenergy-service/wisenergy-service.iml
View file @
c3efd540
This diff is collapsed.
Click to expand it.
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