Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
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 4dd1b11f
authored
May 13, 2021
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
图片上传到本地
1 parent
3a65bab0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
View file @
4dd1b11
...
@@ -149,8 +149,12 @@ public class WeMaterialController extends BaseController {
...
@@ -149,8 +149,12 @@ public class WeMaterialController extends BaseController {
@PostMapping
(
"/uploadimg"
)
@PostMapping
(
"/uploadimg"
)
@ApiOperation
(
"上传素材图片"
)
@ApiOperation
(
"上传素材图片"
)
public
AjaxResult
<
WeMediaDto
>
uploadImg
(
MultipartFile
file
){
public
AjaxResult
<
WeMediaDto
>
uploadImg
(
MultipartFile
file
){
WeMediaDto
weMediaDto
=
materialService
.
uploadImg
(
file
);
WeMediaDto
weMediaDto
=
new
WeMediaDto
();
weMediaDto
.
setFileName
(
file
.
getResource
().
getFilename
());
// WeMediaDto weMediaDto = materialService.uploadImg(file);
// weMediaDto.setFileName(file.getResource().getFilename());
WeMaterialFileVO
weMaterialFileVO
=
materialService
.
uploadWeMaterialFile
(
file
,
MediaType
.
IMAGE
.
getType
());
weMediaDto
.
setFileName
(
weMaterialFileVO
.
getMaterialName
());
weMediaDto
.
setUrl
(
weMaterialFileVO
.
getMaterialUrl
());
return
AjaxResult
.
success
(
weMediaDto
);
return
AjaxResult
.
success
(
weMediaDto
);
}
}
...
...
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