Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
1c025291
Commit
1c025291
authored
Sep 26, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 评论列表
parent
0c99e85d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
CommentController.java
...oban/manage/web/controller/content/CommentController.java
+16
-0
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/CommentController.java
View file @
1c025291
...
...
@@ -8,6 +8,7 @@ import com.gic.commons.util.PageHelperUtils;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.content.api.dto.comment.ListCommentDTO
;
import
com.gic.content.api.dto.comment.ListSonCommentDTO
;
import
com.gic.content.api.dto.comment.SonCommentInfoDTO
;
import
com.gic.content.api.enums.MaterialPurposeEnum
;
import
com.gic.content.api.enums.UserTypeEnum
;
import
com.gic.content.api.qdto.comment.ListMobileCommentQDTO
;
...
...
@@ -83,6 +84,21 @@ public class CommentController {
if
(!
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
if
(
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
().
getResult
()))
{
return
RestResponse
.
successResult
();
}
List
<
Long
>
contentMaterialCommentIds
=
serviceResponse
.
getResult
().
getResult
().
stream
().
map
(
ListCommentDTO:
:
getContentMaterialCommentId
).
collect
(
Collectors
.
toList
());
//获取子评论信息
ServiceResponse
<
Map
<
Long
,
SonCommentInfoDTO
>>
filterAuditStatusByContentMaterialCommentIds
=
contentMaterialCommentApiService
.
getFilterAuditStatusByContentMaterialCommentIds
(
mobileCommentQDTO
,
contentMaterialCommentIds
);
Map
<
Long
,
SonCommentInfoDTO
>
sonCommentInfoDTOMap
=
filterAuditStatusByContentMaterialCommentIds
.
getResult
();
serviceResponse
.
getResult
().
getResult
().
forEach
(
comment
->
{
if
(
sonCommentInfoDTOMap
.
containsKey
(
comment
.
getContentMaterialCommentId
()))
{
SonCommentInfoDTO
sonCommentInfoDTO
=
sonCommentInfoDTOMap
.
get
(
comment
.
getContentMaterialCommentId
());
comment
.
setSonComments
(
ObjectUtil
.
isNotNull
(
sonCommentInfoDTO
.
getListSonCommentDTO
())
?
Collections
.
singletonList
(
sonCommentInfoDTO
.
getListSonCommentDTO
())
:
new
ArrayList
<>());
comment
.
setSonCommentNum
(
sonCommentInfoDTO
.
getTotal
());
}
});
Page
<
CommentInfoVO
>
commentInfoVOPage
=
PageHelperUtils
.
changePageToCurrentPage
(
serviceResponse
.
getResult
(),
CommentInfoVO
.
class
);
return
RestResponse
.
successResult
(
commentInfoVOPage
);
}
...
...
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