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
b320cec1
Commit
b320cec1
authored
Feb 28, 2022
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关注话题npe
parent
f09ab871
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
TopicManager.java
...c/main/java/com/tanpu/community/manager/TopicManager.java
+10
-8
No files found.
community-service/src/main/java/com/tanpu/community/manager/TopicManager.java
View file @
b320cec1
...
...
@@ -100,9 +100,11 @@ public class TopicManager {
Map
<
String
,
TopicRankQo
>
topicMap
=
rankService
.
getRankTopicList
(
null
).
stream
().
collect
(
Collectors
.
toMap
(
TopicRankQo:
:
getTopicId
,
o
->
o
,
(
a
,
b
)
->
a
));
topicFollowQos
.
stream
().
forEach
(
o
->
{
TopicRankQo
topicRankQo
=
topicMap
.
get
(
o
.
getTopicId
());
BeanUtils
.
copyProperties
(
topicRankQo
,
o
);
o
.
setHasPermission
(
true
);
if
(
topicMap
.
containsKey
(
o
.
getTopicId
()))
{
TopicRankQo
topicRankQo
=
topicMap
.
get
(
o
.
getTopicId
());
BeanUtils
.
copyProperties
(
topicRankQo
,
o
);
o
.
setHasPermission
(
true
);
}
});
...
...
@@ -184,7 +186,7 @@ public class TopicManager {
public
DiscussionAeraQo
getForum
(
TopicDiscussionReq
req
)
{
TopicEntity
topicEntity
=
topicService
.
queryRelateTopic
(
req
);
// 没有关联话题,或者已下线
if
(
topicEntity
==
null
)
return
null
;
if
(
topicEntity
==
null
)
return
null
;
DiscussionAeraQo
result
=
new
DiscussionAeraQo
();
...
...
@@ -192,9 +194,9 @@ public class TopicManager {
List
<
TopicRankQo
>
collect
=
rankTopicList
.
stream
().
filter
(
o
->
o
.
getTopicId
().
equals
(
topicEntity
.
getTopicId
())).
collect
(
Collectors
.
toList
());
BeanUtils
.
copyProperties
(
collect
.
get
(
0
),
result
);
BeanUtils
.
copyProperties
(
collect
.
get
(
0
),
result
);
if
(
result
.
getDisscussCount
()
!=
null
&&
result
.
getDisscussCount
()>
99
)
{
if
(
result
.
getDisscussCount
()
!=
null
&&
result
.
getDisscussCount
()
>
99
)
{
result
.
setFormatDisscussCount
(
"99+"
);
}
...
...
@@ -204,9 +206,9 @@ public class TopicManager {
List
<
String
>
authorIds
=
new
ArrayList
<>(
themeEntities
.
stream
().
map
(
ThemeEntity:
:
getAuthorId
).
collect
(
Collectors
.
toSet
()));
List
<
UserInfoResp
>
queryUsersListNew
=
feignService
.
getUserList
(
authorIds
);
Map
<
String
,
UserInfoResp
>
nameMap
=
queryUsersListNew
.
stream
().
collect
(
Collectors
.
toMap
(
UserInfoResp:
:
getUserId
,
o
->
o
));
Map
<
String
,
UserInfoResp
>
nameMap
=
queryUsersListNew
.
stream
().
collect
(
Collectors
.
toMap
(
UserInfoResp:
:
getUserId
,
o
->
o
));
result
.
setThemes
(
ConvertUtil
.
themeEntity2Discussion
(
themeEntities
,
nameMap
));
result
.
setThemes
(
ConvertUtil
.
themeEntity2Discussion
(
themeEntities
,
nameMap
));
return
result
;
}
...
...
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