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
1a0dbd23
Commit
1a0dbd23
authored
Aug 19, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除评论时删除消息通知
parent
6d0d9613
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
NotificationManager.java
...java/com/tanpu/community/manager/NotificationManager.java
+1
-1
NotificationService.java
...java/com/tanpu/community/service/NotificationService.java
+3
-2
No files found.
community-service/src/main/java/com/tanpu/community/manager/NotificationManager.java
View file @
1a0dbd23
...
...
@@ -140,7 +140,7 @@ public class NotificationManager {
redisCache
.
evict
(
RedisKeyConstant
.
MESSAGE_NOTIFY_COUNT
+
userId
);
// 更新查询时间,用于删除评论
redisCache
.
set
(
RedisKeyConstant
.
MESSAGE_NOTIFY_QUERY_TIME
+
userId
,
String
.
valueOf
(
TimeUtils
.
calMillisTillNow
(
LocalDateTime
.
now
()
)),
60
*
60
*
24
*
30
);
JsonUtil
.
toJson
(
LocalDateTime
.
now
(
)),
60
*
60
*
24
*
30
);
return
themeNotifyQos
;
}
...
...
community-service/src/main/java/com/tanpu/community/service/NotificationService.java
View file @
1a0dbd23
...
...
@@ -230,9 +230,10 @@ public class NotificationService {
}
// 处理更新数量
LocalDateTime
lastQueryTime
=
JsonUtil
.
toBean
(
redisCache
.
get
(
RedisKeyConstant
.
MESSAGE_NOTIFY_QUERY_TIME
+
notifyUserId
),
LocalDateTime
.
class
);
String
lastTime
=
redisCache
.
get
(
RedisKeyConstant
.
MESSAGE_NOTIFY_QUERY_TIME
+
notifyUserId
);
LocalDateTime
lastQueryTime
=
StringUtils
.
isNotBlank
(
lastTime
)?
JsonUtil
.
toBean
(
lastTime
,
LocalDateTime
.
class
):
LocalDateTime
.
now
();
// 如果删除的评论时时间在红点提示时间内,则缓存数-1
if
(
!
TimeUtils
.
lessThan
(
lastQueryTime
,
commentTime
))
{
if
(
StringUtils
.
isBlank
(
lastTime
)
||
TimeUtils
.
lessThan
(
lastQueryTime
,
commentTime
))
{
redisCache
.
decr
(
RedisKeyConstant
.
MESSAGE_NOTIFY_COUNT
+
notifyUserId
);
}
}
...
...
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