Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
ac15232a
Commit
ac15232a
authored
Aug 31, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
点赞评论消息通知 fix
parent
dc2f667c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+3
-1
NotificationService.java
...java/com/tanpu/community/service/NotificationService.java
+5
-1
No files found.
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
View file @
ac15232a
...
@@ -189,8 +189,10 @@ public class CommentManager {
...
@@ -189,8 +189,10 @@ public class CommentManager {
//删除评论
//删除评论
public
void
delete
(
String
commentId
,
String
userId
)
{
public
void
delete
(
String
commentId
,
String
userId
)
{
if
(
StringUtils
.
isBlank
(
commentId
)){
throw
new
BizException
(
"commentId不能为空"
);
}
commentService
.
delete
(
commentId
,
userId
);
commentService
.
delete
(
commentId
,
userId
);
CommentEntity
commentEntity
=
commentService
.
queryByIdIncludeDelete
(
commentId
);
CommentEntity
commentEntity
=
commentService
.
queryByIdIncludeDelete
(
commentId
);
ThemeEntity
themeEntity
=
themeService
.
queryByThemeId
(
commentEntity
.
getThemeId
());
ThemeEntity
themeEntity
=
themeService
.
queryByThemeId
(
commentEntity
.
getThemeId
());
notificationService
.
deleteCommentNotify
(
themeEntity
.
getAuthorId
(),
userId
,
commentId
,
commentEntity
.
getCreateTime
());
notificationService
.
deleteCommentNotify
(
themeEntity
.
getAuthorId
(),
userId
,
commentId
,
commentEntity
.
getCreateTime
());
...
...
community-service/src/main/java/com/tanpu/community/service/NotificationService.java
View file @
ac15232a
...
@@ -232,10 +232,14 @@ public class NotificationService {
...
@@ -232,10 +232,14 @@ public class NotificationService {
NotificationEntity
commentNotify
=
notificationMapper
.
selectOne
(
new
LambdaQueryWrapper
<
NotificationEntity
>()
NotificationEntity
commentNotify
=
notificationMapper
.
selectOne
(
new
LambdaQueryWrapper
<
NotificationEntity
>()
.
eq
(
NotificationEntity:
:
getTargetId
,
commentId
)
.
eq
(
NotificationEntity:
:
getTargetId
,
commentId
)
.
eq
(
NotificationEntity:
:
getOperatorId
,
operatorId
)
.
eq
(
NotificationEntity:
:
getOperatorId
,
operatorId
)
.
eq
(
NotificationEntity:
:
getMessageType
,
NotificationTypeEnum
.
COMMENT
.
getType
()));
.
eq
(
NotificationEntity:
:
getNotifiedUserId
,
notifyUserId
)
.
eq
(
NotificationEntity:
:
getMessageType
,
NotificationTypeEnum
.
COMMENT
.
getCode
()));
NotificationEntity
last
=
notificationMapper
.
selectOne
(
new
LambdaQueryWrapper
<
NotificationEntity
>().
eq
(
NotificationEntity:
:
getNotifiedUserId
,
notifyUserId
)
NotificationEntity
last
=
notificationMapper
.
selectOne
(
new
LambdaQueryWrapper
<
NotificationEntity
>().
eq
(
NotificationEntity:
:
getNotifiedUserId
,
notifyUserId
)
.
orderByDesc
(
NotificationEntity:
:
getUpdateTime
)
.
orderByDesc
(
NotificationEntity:
:
getUpdateTime
)
.
last
(
"limit 1"
));
.
last
(
"limit 1"
));
if
(
commentNotify
==
null
||
last
==
null
){
return
;
}
notificationMapper
.
deleteById
(
commentNotify
.
getId
());
notificationMapper
.
deleteById
(
commentNotify
.
getId
());
// 如果删除的评论是最後一條通知,则需要从库中再找一条最新的
// 如果删除的评论是最後一條通知,则需要从库中再找一条最新的
if
(
last
.
getNotificationId
().
equals
(
commentNotify
.
getNotificationId
()))
{
if
(
last
.
getNotificationId
().
equals
(
commentNotify
.
getNotificationId
()))
{
...
...
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