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
73ef6161
Commit
73ef6161
authored
Mar 10, 2021
by
m1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资讯模块数据——视频功能修复
parent
de681f68
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
12 deletions
+21
-12
UploadServiceImpl.java
...java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
+16
-7
LastAccountController.java
...nergy/web/admin/controller/app/LastAccountController.java
+5
-5
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
View file @
73ef6161
...
@@ -48,10 +48,10 @@ public class UploadServiceImpl implements UploadService {
...
@@ -48,10 +48,10 @@ public class UploadServiceImpl implements UploadService {
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
>();
/**
/**
* http://路径
* http://路径 request.getScheme() + "://" + request.getServerName()
* + ":" + request.getServerPort()+/upload/";"
*/
*/
String
basePath
=
request
.
getScheme
()
+
"://"
+
request
.
getServerName
()
String
basePath
=
"/upload/"
;
+
":"
+
request
.
getServerPort
()+
"/upload/"
;
Long
time
=
new
Date
().
getTime
();
Long
time
=
new
Date
().
getTime
();
String
fileName
=
file
.
getOriginalFilename
();
//文件原始名称
String
fileName
=
file
.
getOriginalFilename
();
//文件原始名称
...
@@ -105,8 +105,9 @@ public class UploadServiceImpl implements UploadService {
...
@@ -105,8 +105,9 @@ public class UploadServiceImpl implements UploadService {
*/
*/
Long
zxDate
=
Long
.
valueOf
(
System
.
currentTimeMillis
());
Long
zxDate
=
Long
.
valueOf
(
System
.
currentTimeMillis
());
String
basePath
=
request
.
getScheme
()
+
"://"
+
request
.
getServerName
()
// request.getScheme() + "://" + request.getServerName()
+
":"
+
request
.
getServerPort
()+
"/mimi/upload/"
;
// + ":" + request.getServerPort()+"/upload/";
String
basePath
=
"/upload/"
;
Long
time
=
System
.
currentTimeMillis
();
Long
time
=
System
.
currentTimeMillis
();
...
@@ -114,7 +115,7 @@ public class UploadServiceImpl implements UploadService {
...
@@ -114,7 +115,7 @@ public class UploadServiceImpl implements UploadService {
String
suffixName
=
zxName
.
substring
(
zxName
.
lastIndexOf
(
"."
));
//从最后一个.开始截取。截取zxName的后缀名
String
suffixName
=
zxName
.
substring
(
zxName
.
lastIndexOf
(
"."
));
//从最后一个.开始截取。截取zxName的后缀名
String
newzxName
=
time
+
suffixName
;
//文件新名称
String
newzxName
=
time
+
suffixName
;
//文件新名称
//设置文件存储路径,可以存放在你想要指定的路径里面
//设置文件存储路径,可以存放在你想要指定的路径里面
String
rootPath
=
"/opt/upload/
video/
"
;
//上传图片存放位置
String
rootPath
=
"/opt/upload/"
;
//上传图片存放位置
String
filePath
=
rootPath
+
newzxName
;
String
filePath
=
rootPath
+
newzxName
;
File
newFile
=
new
File
(
filePath
);
File
newFile
=
new
File
(
filePath
);
...
@@ -135,6 +136,14 @@ public class UploadServiceImpl implements UploadService {
...
@@ -135,6 +136,14 @@ public class UploadServiceImpl implements UploadService {
return
resultMap
;
return
resultMap
;
}
}
/**
* 多图片
* @param files
* @param zxField
* @param zxAddress
* @param inviteCode
* @return
*/
@Override
@Override
public
List
imageUpload
(
MultipartFile
[]
files
,
String
zxField
,
String
zxAddress
,
String
inviteCode
)
{
public
List
imageUpload
(
MultipartFile
[]
files
,
String
zxField
,
String
zxAddress
,
String
inviteCode
)
{
//获取上传图片数量,打印在控制台
//获取上传图片数量,打印在控制台
...
@@ -158,7 +167,7 @@ public class UploadServiceImpl implements UploadService {
...
@@ -158,7 +167,7 @@ public class UploadServiceImpl implements UploadService {
String
fileType
=
file
.
getContentType
();
String
fileType
=
file
.
getContentType
();
if
(
fileType
.
equals
(
"image/jpeg"
)
||
fileType
.
equals
(
"image/png"
))
{
if
(
fileType
.
equals
(
"image/jpeg"
)
||
fileType
.
equals
(
"image/png"
))
{
// 要上传的目标文件存放的绝对路径
// 要上传的目标文件存放的绝对路径
String
rootPath
=
"D:/
mimi/upload/images
/"
;
//上传图片存放位置
String
rootPath
=
"D:/
upload
/"
;
//上传图片存放位置
//上传后保存的文件名(需要防止图片重名导致的文件覆盖)
//上传后保存的文件名(需要防止图片重名导致的文件覆盖)
//获取文件名
//获取文件名
fileName
=
file
.
getOriginalFilename
();
fileName
=
file
.
getOriginalFilename
();
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/LastAccountController.java
View file @
73ef6161
...
@@ -22,9 +22,9 @@ public class LastAccountController {
...
@@ -22,9 +22,9 @@ public class LastAccountController {
@Autowired
@Autowired
private
AccountService
accountService
;
private
AccountService
accountService
;
@ApiOperation
(
value
=
"复制表-结构和数据"
,
notes
=
"复制表-结构和数据"
,
httpMethod
=
"PUT"
)
//
@ApiOperation(value = "复制表-结构和数据", notes = "复制表-结构和数据", httpMethod = "PUT")
@PutMapping
(
"/add"
)
//
@PutMapping("/add")
public
void
copyTable
(){
//
public void copyTable(){
accountService
.
mirrorImage
();
//
accountService.mirrorImage();
}
//
}
}
}
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