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
700f13aa
Commit
700f13aa
authored
Mar 01, 2022
by
张辰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2.3.1' of
http://47.100.44.39:10001/tp-backend/tanpu-community
into v2.3.1
parents
1e6ce129
c484236c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
TopicManager.java
...c/main/java/com/tanpu/community/manager/TopicManager.java
+10
-8
TopicEntityMapper.xml
...src/main/resources/mapper/community/TopicEntityMapper.xml
+1
-1
No files found.
community-service/src/main/java/com/tanpu/community/manager/TopicManager.java
View file @
700f13aa
...
@@ -100,9 +100,11 @@ public class TopicManager {
...
@@ -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
));
Map
<
String
,
TopicRankQo
>
topicMap
=
rankService
.
getRankTopicList
(
null
).
stream
().
collect
(
Collectors
.
toMap
(
TopicRankQo:
:
getTopicId
,
o
->
o
,
(
a
,
b
)
->
a
));
topicFollowQos
.
stream
().
forEach
(
o
->
{
topicFollowQos
.
stream
().
forEach
(
o
->
{
if
(
topicMap
.
containsKey
(
o
.
getTopicId
()))
{
TopicRankQo
topicRankQo
=
topicMap
.
get
(
o
.
getTopicId
());
TopicRankQo
topicRankQo
=
topicMap
.
get
(
o
.
getTopicId
());
BeanUtils
.
copyProperties
(
topicRankQo
,
o
);
BeanUtils
.
copyProperties
(
topicRankQo
,
o
);
o
.
setHasPermission
(
true
);
o
.
setHasPermission
(
true
);
}
});
});
...
@@ -184,7 +186,7 @@ public class TopicManager {
...
@@ -184,7 +186,7 @@ public class TopicManager {
public
DiscussionAeraQo
getForum
(
TopicDiscussionReq
req
)
{
public
DiscussionAeraQo
getForum
(
TopicDiscussionReq
req
)
{
TopicEntity
topicEntity
=
topicService
.
queryRelateTopic
(
req
);
TopicEntity
topicEntity
=
topicService
.
queryRelateTopic
(
req
);
// 没有关联话题,或者已下线
// 没有关联话题,或者已下线
if
(
topicEntity
==
null
)
return
null
;
if
(
topicEntity
==
null
)
return
null
;
DiscussionAeraQo
result
=
new
DiscussionAeraQo
();
DiscussionAeraQo
result
=
new
DiscussionAeraQo
();
...
@@ -192,9 +194,9 @@ public class TopicManager {
...
@@ -192,9 +194,9 @@ public class TopicManager {
List
<
TopicRankQo
>
collect
=
rankTopicList
.
stream
().
filter
(
o
->
o
.
getTopicId
().
equals
(
topicEntity
.
getTopicId
())).
collect
(
Collectors
.
toList
());
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+"
);
result
.
setFormatDisscussCount
(
"99+"
);
}
}
...
@@ -204,9 +206,9 @@ public class TopicManager {
...
@@ -204,9 +206,9 @@ public class TopicManager {
List
<
String
>
authorIds
=
new
ArrayList
<>(
themeEntities
.
stream
().
map
(
ThemeEntity:
:
getAuthorId
).
collect
(
Collectors
.
toSet
()));
List
<
String
>
authorIds
=
new
ArrayList
<>(
themeEntities
.
stream
().
map
(
ThemeEntity:
:
getAuthorId
).
collect
(
Collectors
.
toSet
()));
List
<
UserInfoResp
>
queryUsersListNew
=
feignService
.
getUserList
(
authorIds
);
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
;
return
result
;
}
}
...
...
community-service/src/main/resources/mapper/community/TopicEntityMapper.xml
View file @
700f13aa
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from topic
from topic
where topic_id in
where
is_conceal = 0 and delete_tag = 0 and
topic_id in
<foreach
item=
"item"
index=
"index"
collection=
"topicIdCollection"
<foreach
item=
"item"
index=
"index"
collection=
"topicIdCollection"
open=
"("
separator=
","
close=
")"
>
open=
"("
separator=
","
close=
")"
>
#{item}
#{item}
...
...
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