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
ba919f8c
Commit
ba919f8c
authored
Aug 16, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息通知 fix
parent
94a20617
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+2
-2
HomePageManager.java
...ain/java/com/tanpu/community/manager/HomePageManager.java
+2
-2
NotificationManager.java
...java/com/tanpu/community/manager/NotificationManager.java
+7
-7
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+2
-2
No files found.
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
View file @
ba919f8c
...
...
@@ -177,7 +177,7 @@ public class CommentManager {
private
void
messageNotify
(
String
notifyUserId
,
String
operatorId
,
NotificationTypeEnum
type
){
UserInfoResp
userInfo
=
getUserInfo
(
operatorId
);
redisCache
.
incr
(
RedisKeyConstant
.
MESSAGE_NOTIFY_COUNT
+
notifyUserId
);
redisCache
.
pu
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_MSG
+
notifyUserId
,
userInfo
.
getNickName
()+
type
.
getType
()+
"了你的内容"
,
60
*
60
*
24
*
30
);
redisCache
.
pu
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_TIME
+
notifyUserId
,
TimeUtils
.
format
(
LocalDateTime
.
now
()),
60
*
60
*
24
*
30
);
redisCache
.
se
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_MSG
+
notifyUserId
,
userInfo
.
getNickName
()+
type
.
getType
()+
"了你的内容"
,
60
*
60
*
24
*
30
);
redisCache
.
se
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_TIME
+
notifyUserId
,
TimeUtils
.
format
(
LocalDateTime
.
now
()),
60
*
60
*
24
*
30
);
}
}
community-service/src/main/java/com/tanpu/community/manager/HomePageManager.java
View file @
ba919f8c
...
...
@@ -249,8 +249,8 @@ public class HomePageManager {
private
void
messageFollowNotify
(
String
notifyUserId
,
String
operatorId
)
{
UserInfoResp
userInfo
=
getUserInfo
(
operatorId
);
redisCache
.
incr
(
RedisKeyConstant
.
MESSAGE_NOTIFY_COUNT
+
notifyUserId
);
redisCache
.
pu
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_MSG
+
notifyUserId
,
userInfo
.
getNickName
()
+
"关注了你"
,
60
*
60
*
24
*
30
);
redisCache
.
pu
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_TIME
+
notifyUserId
,
TimeUtils
.
format
(
LocalDateTime
.
now
()),
60
*
60
*
24
*
30
);
redisCache
.
se
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_MSG
+
notifyUserId
,
userInfo
.
getNickName
()
+
"关注了你"
,
60
*
60
*
24
*
30
);
redisCache
.
se
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_TIME
+
notifyUserId
,
TimeUtils
.
format
(
LocalDateTime
.
now
()),
60
*
60
*
24
*
30
);
}
private
UserInfoResp
getUserInfo
(
String
authorId
)
{
...
...
community-service/src/main/java/com/tanpu/community/manager/NotificationManager.java
View file @
ba919f8c
...
...
@@ -97,7 +97,7 @@ public class NotificationManager {
ThemeEntity
former
=
themeService
.
queryByThemeId
(
themeNotifyQo
.
getFormerThemeId
());
if
(
former
!=
null
)
{
themeNotifyQo
.
setFormerUserName
(
currentUser
.
getNickName
());
if
(
ThemeTypeEnum
.
DISCUSSION
.
getCode
().
equals
(
former
.
getThemeType
()))
{
if
(
ThemeTypeEnum
.
DISCUSSION
.
getCode
().
equals
(
former
.
getThemeType
())
||
ThemeTypeEnum
.
FORWARD
.
getCode
().
equals
(
former
.
getThemeType
())
)
{
List
<
ThemeContentQo
>
themeContentQos
=
JsonUtil
.
toBean
(
former
.
getContent
(),
new
TypeReference
<
List
<
ThemeContentQo
>>()
{
});
themeNotifyQo
.
setFormerContent
(
themeContentQos
.
get
(
0
).
getValue
());
...
...
@@ -114,8 +114,8 @@ public class NotificationManager {
if
(
themeNotifyQo
.
getLikeUserCount
()!=
null
&&
themeNotifyQo
.
getLikeUserCount
()>
1
)
{
List
<
UserBriefInfoQO
>
likeUsers
=
themeNotifyQo
.
getLikeUsers
();
for
(
UserBriefInfoQO
likeUser
:
likeUsers
)
{
UserInfoResp
luser
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
"_"
,
CACHE_FEIGN_USER_INFO
,
themeNotifyQo
.
getAutho
rId
()),
60
,
()
->
this
.
getUserInfo
(
themeNotifyQo
.
getAutho
rId
()),
UserInfoResp
.
class
);
UserInfoResp
luser
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
"_"
,
CACHE_FEIGN_USER_INFO
,
likeUser
.
getUse
rId
()),
60
,
()
->
this
.
getUserInfo
(
likeUser
.
getUse
rId
()),
UserInfoResp
.
class
);
likeUser
.
setHeadImageUrl
(
luser
.
getHeadImageUrl
());
likeUser
.
setNickName
(
luser
.
getNickName
());
}
...
...
@@ -208,16 +208,16 @@ public class NotificationManager {
private
void
messageNotify
(
String
notifyUserId
,
String
operatorId
,
NotificationTypeEnum
type
)
{
UserInfoResp
userInfo
=
getUserInfo
(
operatorId
);
redisCache
.
incr
(
RedisKeyConstant
.
MESSAGE_NOTIFY_COUNT
+
notifyUserId
);
redisCache
.
pu
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_MSG
+
notifyUserId
,
userInfo
.
getNickName
()
+
type
.
getType
()
+
"了你的内容"
,
60
*
60
*
24
*
30
);
redisCache
.
pu
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_TIME
+
notifyUserId
,
TimeUtils
.
format
(
LocalDateTime
.
now
()),
60
*
60
*
24
*
30
);
redisCache
.
se
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_MSG
+
notifyUserId
,
userInfo
.
getNickName
()
+
type
.
getType
()
+
"了你的内容"
,
60
*
60
*
24
*
30
);
redisCache
.
se
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_TIME
+
notifyUserId
,
TimeUtils
.
format
(
LocalDateTime
.
now
()),
60
*
60
*
24
*
30
);
}
// 消息通知队列缓存
private
void
messageNotifyFollow
(
String
notifyUserId
,
String
operatorId
)
{
UserInfoResp
userInfo
=
getUserInfo
(
operatorId
);
redisCache
.
incr
(
RedisKeyConstant
.
MESSAGE_NOTIFY_COUNT
+
notifyUserId
);
redisCache
.
pu
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_MSG
+
notifyUserId
,
userInfo
.
getNickName
()
+
"关注了你"
,
60
*
60
*
24
*
30
);
redisCache
.
pu
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_TIME
+
notifyUserId
,
TimeUtils
.
format
(
LocalDateTime
.
now
()),
60
*
60
*
24
*
30
);
redisCache
.
se
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_MSG
+
notifyUserId
,
userInfo
.
getNickName
()
+
"关注了你"
,
60
*
60
*
24
*
30
);
redisCache
.
se
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_TIME
+
notifyUserId
,
TimeUtils
.
format
(
LocalDateTime
.
now
()),
60
*
60
*
24
*
30
);
}
private
UserInfoResp
getUserInfo
(
String
authorId
)
{
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
ba919f8c
...
...
@@ -931,8 +931,8 @@ public class ThemeManager {
private
void
messageNotify
(
String
notifyUserId
,
String
operatorId
,
NotificationTypeEnum
type
){
UserInfoResp
userInfo
=
getUserInfo
(
operatorId
);
redisCache
.
incr
(
RedisKeyConstant
.
MESSAGE_NOTIFY_COUNT
+
notifyUserId
);
redisCache
.
pu
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_MSG
+
notifyUserId
,
userInfo
.
getNickName
()+
type
.
getType
()+
"了你的内容"
,
60
*
60
*
24
*
30
);
redisCache
.
pu
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_TIME
+
notifyUserId
,
TimeUtils
.
format
(
LocalDateTime
.
now
()),
60
*
60
*
24
*
30
);
redisCache
.
se
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_MSG
+
notifyUserId
,
userInfo
.
getNickName
()+
type
.
getType
()+
"了你的内容"
,
60
*
60
*
24
*
30
);
redisCache
.
se
t
(
RedisKeyConstant
.
MESSAGE_NOTIFY_LAST_TIME
+
notifyUserId
,
TimeUtils
.
format
(
LocalDateTime
.
now
()),
60
*
60
*
24
*
30
);
}
}
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