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
acb44665
Commit
acb44665
authored
Jul 15, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
话题列表fix
parent
5d29373d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
CommentService.java
...main/java/com/tanpu/community/service/CommentService.java
+4
-0
ThemeService.java
...c/main/java/com/tanpu/community/service/ThemeService.java
+4
-0
No files found.
community-service/src/main/java/com/tanpu/community/service/CommentService.java
View file @
acb44665
...
@@ -7,6 +7,7 @@ import com.tanpu.community.api.enums.DeleteTagEnum;
...
@@ -7,6 +7,7 @@ import com.tanpu.community.api.enums.DeleteTagEnum;
import
com.tanpu.community.api.enums.TopicStatusEnum
;
import
com.tanpu.community.api.enums.TopicStatusEnum
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.mapper.community.CommentMapper
;
import
com.tanpu.community.dao.mapper.community.CommentMapper
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -38,6 +39,9 @@ public class CommentService {
...
@@ -38,6 +39,9 @@ public class CommentService {
//统计主题集合的评论量
//统计主题集合的评论量
public
Integer
getCommentCountByThemeIds
(
List
<
String
>
themeIds
)
{
public
Integer
getCommentCountByThemeIds
(
List
<
String
>
themeIds
)
{
if
(
CollectionUtils
.
isEmpty
(
themeIds
)){
return
0
;
}
return
commentMapper
.
selectList
((
new
LambdaQueryWrapper
<
CommentEntity
>()
return
commentMapper
.
selectList
((
new
LambdaQueryWrapper
<
CommentEntity
>()
.
in
(
CommentEntity:
:
getThemeId
,
themeIds
)))
.
in
(
CommentEntity:
:
getThemeId
,
themeIds
)))
.
size
();
.
size
();
...
...
community-service/src/main/java/com/tanpu/community/service/ThemeService.java
View file @
acb44665
...
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
...
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -95,6 +96,9 @@ public class ThemeService {
...
@@ -95,6 +96,9 @@ public class ThemeService {
//根据话题查询所有的主题Id
//根据话题查询所有的主题Id
public
List
<
String
>
queryThemeIdsByTopic
(
String
topidId
)
{
public
List
<
String
>
queryThemeIdsByTopic
(
String
topidId
)
{
if
(
StringUtils
.
isEmpty
(
topidId
)){
return
Collections
.
emptyList
();
}
LambdaQueryWrapper
<
ThemeEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<
ThemeEntity
>()
LambdaQueryWrapper
<
ThemeEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<
ThemeEntity
>()
.
eq
(
ThemeEntity:
:
getTopicId
,
topidId
);
.
eq
(
ThemeEntity:
:
getTopicId
,
topidId
);
queryWrapper
.
select
(
ThemeEntity:
:
getThemeId
);
queryWrapper
.
select
(
ThemeEntity:
:
getThemeId
);
...
...
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