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
d8137ccf
Commit
d8137ccf
authored
Mar 09, 2021
by
m1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资讯模块数据——展示功能实现
parent
b0a4039e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
UploadServiceImpl.java
...java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
+3
-3
UploadController.java
.../wisenergy/web/admin/controller/app/UploadController.java
+2
-2
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
View file @
d8137ccf
...
...
@@ -56,12 +56,12 @@ public class UploadServiceImpl implements UploadService {
+
":"
+
request
.
getServerPort
()+
"/mimi/upload/video/"
;
Long
time
=
System
.
currentTimeMillis
();
String
zxName
=
file
.
get
OriginalFilen
ame
();
//文件原始名称
//.getOriginalFilename()
String
zxName
=
file
.
get
N
ame
();
//文件原始名称
String
suffixName
=
zxName
.
substring
(
zxName
.
lastIndexOf
(
"."
));
//从最后一个.开始截取。截取zxName的后缀名
String
newzxName
=
time
+
suffixName
;
//文件新名称
//设置文件存储路径,可以存放在你想要指定的路径里面
String
rootPath
=
"http:/mimi/"
+
File
.
separator
+
"upload/video/"
;
//上传视频存放位置
String
rootPath
=
basePath
+
File
.
separator
+
"upload/video/"
;
//上传视频存放位置
String
filePath
=
rootPath
+
newzxName
;
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UploadController.java
View file @
d8137ccf
...
...
@@ -58,7 +58,7 @@ public class UploadController {
@ApiImplicitParam
(
name
=
"zxAddress"
,
value
=
"资讯发布地址"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户手机号(发布人)"
,
required
=
true
,
dataType
=
"String"
)})
@RequestMapping
(
value
=
"/uploadVideo"
,
method
=
RequestMethod
.
POST
)
public
Map
<
String
,
Object
>
uploadVideo
(
MultipartFile
file
,
HttpServletRequest
request
,
String
userId
,
String
zxField
,
String
zxAddress
)
throws
Exception
{
public
Map
<
String
,
Object
>
uploadVideo
(
@RequestParam
(
value
=
"files"
)
MultipartFile
file
,
HttpServletRequest
request
,
String
userId
,
String
zxField
,
String
zxAddress
)
throws
Exception
{
return
uploadService
.
uploadVideo
(
file
,
request
,
userId
,
zxField
,
zxAddress
);
}
...
...
@@ -76,7 +76,7 @@ public class UploadController {
@ApiImplicitParam
(
name
=
"zxAddress"
,
value
=
"资讯发布地址"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户手机号"
,
required
=
true
,
dataType
=
"String"
)})
@RequestMapping
(
value
=
"/uploadImage"
,
method
=
RequestMethod
.
POST
)
public
Map
<
String
,
Object
>
uploadImage
(
MultipartFile
file
,
HttpServletRequest
request
,
String
userId
,
String
zxField
,
String
zxAddress
)
throws
Exception
{
public
Map
<
String
,
Object
>
uploadImage
(
@RequestParam
(
value
=
"files"
)
MultipartFile
file
,
HttpServletRequest
request
,
String
userId
,
String
zxField
,
String
zxAddress
)
throws
Exception
{
return
uploadService
.
uploadImage
(
file
,
request
,
userId
,
zxField
,
zxAddress
);
...
...
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