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 3a65bab0
authored
May 13, 2021
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改素材发送BUG
1 parent
a71d1850
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
17 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatCollectionController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
linkwe-framework/src/main/java/com/linkwechat/framework/security/filter/JwtAuthenticationTokenFilter.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatCollectionService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatCollectionServiceImpl.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatCollectionController.java
View file @
3a65bab
...
@@ -35,7 +35,12 @@ public class WeChatCollectionController extends BaseController {
...
@@ -35,7 +35,12 @@ public class WeChatCollectionController extends BaseController {
@Log
(
title
=
"添加收藏"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"添加收藏"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
(
"addCollection"
)
@PostMapping
(
"addCollection"
)
public
AjaxResult
addCollection
(
@RequestBody
WeChatCollectionDto
chatCollectionDto
)
{
public
AjaxResult
addCollection
(
@RequestBody
WeChatCollectionDto
chatCollectionDto
)
{
return
toAjax
(
weChatCollectionService
.
addCollection
(
chatCollectionDto
.
getMaterialId
(),
chatCollectionDto
.
getUserId
()));
boolean
b
=
weChatCollectionService
.
addCollection
(
chatCollectionDto
.
getMaterialId
(),
chatCollectionDto
.
getUserId
());
if
(
weChatCollectionService
.
addCollection
(
chatCollectionDto
.
getMaterialId
(),
chatCollectionDto
.
getUserId
())){
return
AjaxResult
.
success
();
}
return
AjaxResult
.
success
(
"当前素材不可重复收藏"
);
}
}
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeMaterialController.java
View file @
3a65bab
...
@@ -52,12 +52,12 @@ public class WeMaterialController extends BaseController {
...
@@ -52,12 +52,12 @@ public class WeMaterialController extends BaseController {
List
<
WeMaterial
>
list
;
List
<
WeMaterial
>
list
;
if
(
StringUtils
.
isNotBlank
(
mediaType
)
&&
mediaType
.
equals
(
MediaType
.
POSTER
.
getType
())){
if
(
StringUtils
.
isNotBlank
(
mediaType
)
&&
mediaType
.
equals
(
MediaType
.
POSTER
.
getType
())){
list
=
wePosterService
.
list
(
StringUtils
.
isBlank
(
categoryId
)?
null
:
Long
.
valueOf
(
categoryId
),
search
).
stream
().
map
(
wePoster
->
{
list
=
wePosterService
.
list
(
StringUtils
.
isBlank
(
categoryId
)?
null
:
Long
.
valueOf
(
categoryId
),
search
).
stream
().
map
(
wePoster
->
{
WeMaterial
weMaterial
=
new
WeMaterial
();
WeMaterial
weMaterial
=
new
WeMaterial
();
weMaterial
.
setMaterialName
(
wePoster
.
getTitle
());
weMaterial
.
setMaterialName
(
wePoster
.
getTitle
());
weMaterial
.
setMaterialUrl
(
wePoster
.
getSampleImgPath
());
weMaterial
.
setMaterialUrl
(
wePoster
.
getSampleImgPath
());
weMaterial
.
setCategoryId
(
wePoster
.
getCategoryId
());
weMaterial
.
setCategoryId
(
wePoster
.
getCategoryId
());
weMaterial
.
setId
(
wePoster
.
getId
());
weMaterial
.
setId
(
wePoster
.
getId
());
return
weMaterial
;
return
weMaterial
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
else
{
}
else
{
list
=
materialService
.
findWeMaterials
(
categoryId
,
search
,
mediaType
);
list
=
materialService
.
findWeMaterials
(
categoryId
,
search
,
mediaType
);
...
@@ -122,19 +122,29 @@ public class WeMaterialController extends BaseController {
...
@@ -122,19 +122,29 @@ public class WeMaterialController extends BaseController {
return
AjaxResult
.
success
();
return
AjaxResult
.
success
();
}
}
// //@PreAuthorize("@ss.hasPermi('wechat:material:temporaryMaterialMediaId')")
// @Log(title = "获取素材media_id", businessType = BusinessType.OTHER)
// @PostMapping("/temporaryMaterialMediaId")
// @ApiOperation("获取素材media_id")
// public AjaxResult temporaryMaterialMediaId(@RequestBody TemporaryMaterialDto temporaryMaterialDto){
// WeMediaDto weMediaDto = materialService.uploadTemporaryMaterial(temporaryMaterialDto.getUrl(),
// temporaryMaterialDto.getType()
// ,temporaryMaterialDto.getName());
// return AjaxResult.success(weMediaDto);
// }
//@PreAuthorize("@ss.hasPermi('wechat:material:temporaryMaterialMediaId')")
//@PreAuthorize("@ss.hasPermi('wechat:material:temporaryMaterialMediaId')")
@Log
(
title
=
"获取素材media_id"
,
businessType
=
BusinessType
.
OTHER
)
@Log
(
title
=
"获取素材media_id"
,
businessType
=
BusinessType
.
OTHER
)
@
Pos
tMapping
(
"/temporaryMaterialMediaId"
)
@
Ge
tMapping
(
"/temporaryMaterialMediaId"
)
@ApiOperation
(
"获取素材media_id"
)
@ApiOperation
(
"获取素材media_id"
)
public
AjaxResult
temporaryMaterialMediaId
(
@RequestBody
TemporaryMaterialDto
temporaryMaterialDto
){
public
AjaxResult
temporaryMaterialMediaId
(
String
url
,
String
type
,
String
name
){
WeMediaDto
weMediaDto
=
materialService
.
uploadTemporaryMaterial
(
temporaryMaterialDto
.
getUrl
()
,
WeMediaDto
weMediaDto
=
materialService
.
uploadTemporaryMaterial
(
url
,
t
emporaryMaterialDto
.
getType
()
t
ype
,
temporaryMaterialDto
.
getName
()
);
,
name
);
return
AjaxResult
.
success
(
weMediaDto
);
return
AjaxResult
.
success
(
weMediaDto
);
}
}
@Log
(
title
=
"上传素材图片"
,
businessType
=
BusinessType
.
OTHER
)
@Log
(
title
=
"上传素材图片"
,
businessType
=
BusinessType
.
OTHER
)
@PostMapping
(
"/uploadimg"
)
@PostMapping
(
"/uploadimg"
)
@ApiOperation
(
"上传素材图片"
)
@ApiOperation
(
"上传素材图片"
)
...
...
linkwe-framework/src/main/java/com/linkwechat/framework/security/filter/JwtAuthenticationTokenFilter.java
View file @
3a65bab
package
com
.
linkwechat
.
framework
.
security
.
filter
;
package
com
.
linkwechat
.
framework
.
security
.
filter
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Enumeration
;
import
javax.servlet.FilterChain
;
import
javax.servlet.FilterChain
;
import
javax.servlet.ServletException
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -33,6 +34,9 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
...
@@ -33,6 +34,9 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
throws
ServletException
,
IOException
throws
ServletException
,
IOException
{
{
LoginUser
loginUser
=
tokenService
.
getLoginUser
(
request
);
LoginUser
loginUser
=
tokenService
.
getLoginUser
(
request
);
Enumeration
<
String
>
parameterNames
=
request
.
getParameterNames
();
if
(
StringUtils
.
isNotNull
(
loginUser
)
&&
StringUtils
.
isNull
(
SecurityUtils
.
getAuthentication
()))
if
(
StringUtils
.
isNotNull
(
loginUser
)
&&
StringUtils
.
isNull
(
SecurityUtils
.
getAuthentication
()))
{
{
tokenService
.
verifyToken
(
loginUser
);
tokenService
.
verifyToken
(
loginUser
);
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatCollectionService.java
View file @
3a65bab
...
@@ -20,7 +20,7 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
...
@@ -20,7 +20,7 @@ public interface IWeChatCollectionService extends IService<WeChatCollection> {
* @param userId 用户id
* @param userId 用户id
* @return 结果
* @return 结果
*/
*/
public
int
addCollection
(
Long
materialId
,
String
userId
);
public
boolean
addCollection
(
Long
materialId
,
String
userId
);
/**
/**
* 取消收藏
* 取消收藏
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatCollectionServiceImpl.java
View file @
3a65bab
...
@@ -27,18 +27,19 @@ public class WeChatCollectionServiceImpl extends ServiceImpl<WeChatCollectionMap
...
@@ -27,18 +27,19 @@ public class WeChatCollectionServiceImpl extends ServiceImpl<WeChatCollectionMap
@Override
@Override
public
int
addCollection
(
Long
materialId
,
String
userId
)
{
public
boolean
addCollection
(
Long
materialId
,
String
userId
)
{
QueryWrapper
<
WeChatCollection
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
WeChatCollection
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"material_id"
,
materialId
).
eq
(
"user_id"
,
userId
);
wrapper
.
eq
(
"material_id"
,
materialId
).
eq
(
"user_id"
,
userId
);
WeChatCollection
queryCollection
=
weChatCollectionMapper
.
selectOne
(
wrapper
);
WeChatCollection
queryCollection
=
weChatCollectionMapper
.
selectOne
(
wrapper
);
if
(
null
!=
queryCollection
){
if
(
null
!=
queryCollection
){
throw
new
CustomException
(
"你已收藏"
)
;
return
false
;
}
}
WeChatCollection
chatCollection
=
new
WeChatCollection
();
WeChatCollection
chatCollection
=
new
WeChatCollection
();
chatCollection
.
setCollectionId
(
SnowFlakeUtil
.
nextId
());
chatCollection
.
setCollectionId
(
SnowFlakeUtil
.
nextId
());
chatCollection
.
setMaterialId
(
materialId
);
chatCollection
.
setMaterialId
(
materialId
);
chatCollection
.
setUserId
(
userId
);
chatCollection
.
setUserId
(
userId
);
return
weChatCollectionMapper
.
addCollection
(
chatCollection
);
weChatCollectionMapper
.
addCollection
(
chatCollection
);
return
true
;
}
}
@Override
@Override
...
...
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