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 1aaed8f8
authored
Apr 24, 2021
by
孙喜旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
素材图片上传接口返回添加图片名称
1 parent
83741955
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
linkwe-framework/src/main/java/com/linkwechat/framework/config/SecurityConfig.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeMediaDto.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
View file @
1aaed8f
...
...
@@ -13,6 +13,7 @@ import com.linkwechat.wecom.domain.dto.WeMediaDto;
import
com.linkwechat.wecom.domain.vo.WeMaterialFileVO
;
import
com.linkwechat.wecom.service.IWeMaterialService
;
import
com.linkwechat.wecom.service.IWePosterService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -31,6 +32,7 @@ import java.util.stream.Collectors;
* @author KEWEN
* @date 2020-10-08
*/
@Api
(
"企业微信素材管理"
)
@RestController
@RequestMapping
(
"/wecom/material"
)
public
class
WeMaterialController
extends
BaseController
{
...
...
@@ -149,7 +151,9 @@ public class WeMaterialController extends BaseController {
@PostMapping
(
"/uploadimg"
)
@ApiOperation
(
"上传素材图片"
)
public
AjaxResult
<
WeMediaDto
>
uploadImg
(
MultipartFile
file
){
return
AjaxResult
.
success
(
materialService
.
uploadImg
(
file
));
WeMediaDto
weMediaDto
=
materialService
.
uploadImg
(
file
);
weMediaDto
.
setFileName
(
file
.
getResource
().
getFilename
());
return
AjaxResult
.
success
(
weMediaDto
);
}
}
linkwe-framework/src/main/java/com/linkwechat/framework/config/SecurityConfig.java
View file @
1aaed8f
...
...
@@ -131,10 +131,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
//微信授权接口
.
antMatchers
(
"/weixin/auth/**"
).
anonymous
()
//.antMatchers("/wecom/user/synchWeUser").anonymous()
// 除上面外的所有请求全部需要鉴权认证
.
anyRequest
().
authenticated
()
.
and
()
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeMediaDto.java
View file @
1aaed8f
package
com
.
linkwechat
.
wecom
.
domain
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
...
...
@@ -7,6 +9,7 @@ import lombok.Data;
* @Description:
* @Date: create in 2020/9/24 0024 0:16
*/
@ApiModel
@Data
public
class
WeMediaDto
extends
WeResultDto
{
/**媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file)*/
...
...
@@ -16,5 +19,9 @@ public class WeMediaDto extends WeResultDto{
/**媒体文件上传时间戳*/
private
Long
created_at
;
/**上传后得到的图片URL。永久有效*/
@ApiModelProperty
(
"图片路径"
)
private
String
url
;
@ApiModelProperty
(
"图片名称"
)
private
String
fileName
;
}
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