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
5733cebf
Commit
5733cebf
authored
Feb 22, 2022
by
刘基明
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2.3.1' into 'dev'
回复姓名修复 See merge request
!63
parents
014b3442
988f0de7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+8
-6
FeignService.java
...c/main/java/com/tanpu/community/service/FeignService.java
+5
-3
No files found.
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
View file @
5733cebf
...
...
@@ -21,6 +21,7 @@ import com.tanpu.community.dao.entity.community.ThemeEntity;
import
com.tanpu.community.feign.fatools.FeignClientForFatools
;
import
com.tanpu.community.service.CollectionService
;
import
com.tanpu.community.service.CommentService
;
import
com.tanpu.community.service.FeignService
;
import
com.tanpu.community.service.NotificationService
;
import
com.tanpu.community.service.ReportLogService
;
import
com.tanpu.community.service.ThemeService
;
...
...
@@ -65,6 +66,8 @@ public class CommentManager {
private
ThemeService
themeService
;
@Resource
private
TopicService
topicService
;
@Resource
private
FeignService
feignService
;
// 评论(对主题)
// 发表评论(对主题)
...
...
@@ -136,9 +139,9 @@ public class CommentManager {
buildUserInfo
(
commentQo
);
// 是否点赞及点赞数
String
commentId
=
commentQo
.
getCommentId
();
Integer
likeCount
=
collectionService
.
getCountByTypeAndId
(
commentId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
commentQo
.
setLikeCount
(
likeCount
);
commentQo
.
setHasLiked
(
likeCommentList
.
contains
(
commentId
));
Integer
countByTypeAndId
=
collectionService
.
getCountByTypeAndId
(
commentId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
commentQo
.
setLikeCount
(
countByTypeAndId
);
// 是否管理员
if
(
managerId
.
contains
(
commentQo
.
getAuthorId
()))
{
commentQo
.
setManager
(
true
);
...
...
@@ -170,10 +173,9 @@ public class CommentManager {
}
// 回复用户名
if
(
StringUtils
.
isNotBlank
(
commentQo
.
getReplyUserId
()))
{
UserInfoResp
replyUser
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
"_"
,
CACHE_FEIGN_USER_INFO
,
authorId
),
60
,
()
->
this
.
getUserInfo
(
commentQo
.
getReplyUserId
()),
UserInfoResp
.
class
);
if
(
replyUser
!=
null
)
{
commentQo
.
setReplyUserName
(
replyUser
.
getNickName
());
UserInfoResp
userResp
=
feignService
.
getUserInfoById
(
commentQo
.
getReplyUserId
());
if
(
userResp
!=
null
)
{
commentQo
.
setReplyUserName
(
userResp
.
getNickName
());
}
}
...
...
community-service/src/main/java/com/tanpu/community/service/FeignService.java
View file @
5733cebf
...
...
@@ -20,6 +20,7 @@ import com.tanpu.community.feign.product.FeignForPublicFund;
import
com.tanpu.community.feign.tanpuroom.FeignClientForTanpuroom
;
import
com.tanpu.community.feign.zhibo.FeignClientForZhibo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -63,11 +64,12 @@ public class FeignService {
public
UserInfoResp
getUserInfoById
(
String
userId
)
{
CommonResp
<
UserInfoResp
>
userInfoNewCommonResp
=
feignClientForFatools
.
queryUserInfoNew
(
userId
);
if
(
userInfoNewCommonResp
.
isNotSuccess
())
{
List
<
UserInfoResp
>
userList
=
getUserList
(
Arrays
.
asList
(
userId
));
if
(
CollectionUtils
.
isEmpty
(
userList
))
{
throw
new
BizException
(
"内部接口调用失败"
);
}
return
user
InfoNewCommonResp
.
getData
(
);
return
user
List
.
get
(
0
);
}
public
List
<
ShortVideoBaseInfoResp
>
batchGetShortVideoBaseInfo
(
List
<
String
>
sourceIds
)
{
...
...
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