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
6bd2c1f6
Commit
6bd2c1f6
authored
Aug 16, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息通知 fix
parent
2653c228
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
ThemeNotifyQo.java
.../java/com/tanpu/community/api/beans/qo/ThemeNotifyQo.java
+5
-5
NotificationManager.java
...java/com/tanpu/community/manager/NotificationManager.java
+7
-0
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeNotifyQo.java
View file @
6bd2c1f6
...
@@ -23,16 +23,16 @@ public class ThemeNotifyQo {
...
@@ -23,16 +23,16 @@ public class ThemeNotifyQo {
@ApiModelProperty
(
value
=
"1:转发 2:点赞 3:评论 4:关注"
)
@ApiModelProperty
(
value
=
"1:转发 2:点赞 3:评论 4:关注"
)
private
Integer
messageType
;
private
Integer
messageType
;
@ApiModelProperty
(
value
=
"
作者
id"
)
@ApiModelProperty
(
value
=
"
操作用户
id"
)
public
String
authorId
;
public
String
authorId
;
@ApiModelProperty
(
value
=
"用户头像"
)
@ApiModelProperty
(
value
=
"
操作
用户头像"
)
public
String
userImg
;
public
String
userImg
;
@ApiModelProperty
(
value
=
"昵称"
)
@ApiModelProperty
(
value
=
"
操作用户
昵称"
)
public
String
nickName
;
public
String
nickName
;
@ApiModelProperty
(
value
=
"用户简介"
)
@ApiModelProperty
(
value
=
"
操作
用户简介"
)
private
String
userIntroduction
;
private
String
userIntroduction
;
@ApiModelProperty
(
value
=
"当前用户是否关注该
作者
"
)
@ApiModelProperty
(
value
=
"当前用户是否关注该
操作用户
"
)
public
boolean
follow
;
public
boolean
follow
;
@ApiModelProperty
(
value
=
"认证机构"
)
@ApiModelProperty
(
value
=
"认证机构"
)
private
String
authOrg
;
private
String
authOrg
;
...
...
community-service/src/main/java/com/tanpu/community/manager/NotificationManager.java
View file @
6bd2c1f6
...
@@ -40,6 +40,8 @@ import org.springframework.stereotype.Service;
...
@@ -40,6 +40,8 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
static
com
.
tanpu
.
community
.
api
.
constants
.
RedisKeyConstant
.
CACHE_FEIGN_USER_INFO
;
import
static
com
.
tanpu
.
community
.
api
.
constants
.
RedisKeyConstant
.
CACHE_FEIGN_USER_INFO
;
...
@@ -79,6 +81,7 @@ public class NotificationManager {
...
@@ -79,6 +81,7 @@ public class NotificationManager {
List
<
ThemeNotifyQo
>
themeNotifyQos
=
ConvertUtil
.
notificationEntitiy2ThemeQos
(
query
);
List
<
ThemeNotifyQo
>
themeNotifyQos
=
ConvertUtil
.
notificationEntitiy2ThemeQos
(
query
);
UserInfoResp
currentUser
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
"_"
,
CACHE_FEIGN_USER_INFO
,
userId
),
UserInfoResp
currentUser
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
"_"
,
CACHE_FEIGN_USER_INFO
,
userId
),
60
,
()
->
this
.
getUserInfo
(
userId
),
UserInfoResp
.
class
);
60
,
()
->
this
.
getUserInfo
(
userId
),
UserInfoResp
.
class
);
Set
<
String
>
followUserIds
=
followRelService
.
queryIdolsByFansId
(
userId
).
stream
().
collect
(
Collectors
.
toSet
());
for
(
ThemeNotifyQo
themeNotifyQo
:
themeNotifyQos
)
{
for
(
ThemeNotifyQo
themeNotifyQo
:
themeNotifyQos
)
{
// 用户信息
// 用户信息
...
@@ -107,10 +110,12 @@ public class NotificationManager {
...
@@ -107,10 +110,12 @@ public class NotificationManager {
}
}
}
}
}
}
// 话题
if
(
StringUtils
.
isNotEmpty
(
themeNotifyQo
.
getTopicId
()))
{
if
(
StringUtils
.
isNotEmpty
(
themeNotifyQo
.
getTopicId
()))
{
TopicEntity
topicEntity
=
topicService
.
queryById
(
themeNotifyQo
.
getTopicId
());
TopicEntity
topicEntity
=
topicService
.
queryById
(
themeNotifyQo
.
getTopicId
());
themeNotifyQo
.
setTopicTitle
(
topicEntity
.
getTopicTitle
());
themeNotifyQo
.
setTopicTitle
(
topicEntity
.
getTopicTitle
());
}
}
// 点赞聚合
if
(
themeNotifyQo
.
getLikeUserCount
()!=
null
&&
themeNotifyQo
.
getLikeUserCount
()>
1
)
{
if
(
themeNotifyQo
.
getLikeUserCount
()!=
null
&&
themeNotifyQo
.
getLikeUserCount
()>
1
)
{
List
<
UserBriefInfoQO
>
likeUsers
=
themeNotifyQo
.
getLikeUsers
();
List
<
UserBriefInfoQO
>
likeUsers
=
themeNotifyQo
.
getLikeUsers
();
for
(
UserBriefInfoQO
likeUser
:
likeUsers
)
{
for
(
UserBriefInfoQO
likeUser
:
likeUsers
)
{
...
@@ -120,6 +125,8 @@ public class NotificationManager {
...
@@ -120,6 +125,8 @@ public class NotificationManager {
likeUser
.
setNickName
(
luser
.
getNickName
());
likeUser
.
setNickName
(
luser
.
getNickName
());
}
}
}
}
// 是否关注
themeNotifyQo
.
setFollow
(
followUserIds
.
contains
(
themeNotifyQo
.
getAuthorId
()));
}
}
redisCache
.
evict
(
RedisKeyConstant
.
MESSAGE_NOTIFY_COUNT
+
userId
);
redisCache
.
evict
(
RedisKeyConstant
.
MESSAGE_NOTIFY_COUNT
+
userId
);
...
...
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