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
988f0de7
Commit
988f0de7
authored
Feb 22, 2022
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回复姓名修复
parent
db65dc1e
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 @
988f0de7
...
@@ -21,6 +21,7 @@ import com.tanpu.community.dao.entity.community.ThemeEntity;
...
@@ -21,6 +21,7 @@ import com.tanpu.community.dao.entity.community.ThemeEntity;
import
com.tanpu.community.feign.fatools.FeignClientForFatools
;
import
com.tanpu.community.feign.fatools.FeignClientForFatools
;
import
com.tanpu.community.service.CollectionService
;
import
com.tanpu.community.service.CollectionService
;
import
com.tanpu.community.service.CommentService
;
import
com.tanpu.community.service.CommentService
;
import
com.tanpu.community.service.FeignService
;
import
com.tanpu.community.service.NotificationService
;
import
com.tanpu.community.service.NotificationService
;
import
com.tanpu.community.service.ReportLogService
;
import
com.tanpu.community.service.ReportLogService
;
import
com.tanpu.community.service.ThemeService
;
import
com.tanpu.community.service.ThemeService
;
...
@@ -65,6 +66,8 @@ public class CommentManager {
...
@@ -65,6 +66,8 @@ public class CommentManager {
private
ThemeService
themeService
;
private
ThemeService
themeService
;
@Resource
@Resource
private
TopicService
topicService
;
private
TopicService
topicService
;
@Resource
private
FeignService
feignService
;
// 评论(对主题)
// 评论(对主题)
// 发表评论(对主题)
// 发表评论(对主题)
...
@@ -136,9 +139,9 @@ public class CommentManager {
...
@@ -136,9 +139,9 @@ public class CommentManager {
buildUserInfo
(
commentQo
);
buildUserInfo
(
commentQo
);
// 是否点赞及点赞数
// 是否点赞及点赞数
String
commentId
=
commentQo
.
getCommentId
();
String
commentId
=
commentQo
.
getCommentId
();
Integer
likeCount
=
collectionService
.
getCountByTypeAndId
(
commentId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
commentQo
.
setLikeCount
(
likeCount
);
commentQo
.
setHasLiked
(
likeCommentList
.
contains
(
commentId
));
commentQo
.
setHasLiked
(
likeCommentList
.
contains
(
commentId
));
Integer
countByTypeAndId
=
collectionService
.
getCountByTypeAndId
(
commentId
,
CollectionTypeEnum
.
LIKE_COMMENT
);
commentQo
.
setLikeCount
(
countByTypeAndId
);
// 是否管理员
// 是否管理员
if
(
managerId
.
contains
(
commentQo
.
getAuthorId
()))
{
if
(
managerId
.
contains
(
commentQo
.
getAuthorId
()))
{
commentQo
.
setManager
(
true
);
commentQo
.
setManager
(
true
);
...
@@ -170,10 +173,9 @@ public class CommentManager {
...
@@ -170,10 +173,9 @@ public class CommentManager {
}
}
// 回复用户名
// 回复用户名
if
(
StringUtils
.
isNotBlank
(
commentQo
.
getReplyUserId
()))
{
if
(
StringUtils
.
isNotBlank
(
commentQo
.
getReplyUserId
()))
{
UserInfoResp
replyUser
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
"_"
,
CACHE_FEIGN_USER_INFO
,
authorId
),
UserInfoResp
userResp
=
feignService
.
getUserInfoById
(
commentQo
.
getReplyUserId
());
60
,
()
->
this
.
getUserInfo
(
commentQo
.
getReplyUserId
()),
UserInfoResp
.
class
);
if
(
userResp
!=
null
)
{
if
(
replyUser
!=
null
)
{
commentQo
.
setReplyUserName
(
userResp
.
getNickName
());
commentQo
.
setReplyUserName
(
replyUser
.
getNickName
());
}
}
}
}
...
...
community-service/src/main/java/com/tanpu/community/service/FeignService.java
View file @
988f0de7
...
@@ -20,6 +20,7 @@ import com.tanpu.community.feign.product.FeignForPublicFund;
...
@@ -20,6 +20,7 @@ import com.tanpu.community.feign.product.FeignForPublicFund;
import
com.tanpu.community.feign.tanpuroom.FeignClientForTanpuroom
;
import
com.tanpu.community.feign.tanpuroom.FeignClientForTanpuroom
;
import
com.tanpu.community.feign.zhibo.FeignClientForZhibo
;
import
com.tanpu.community.feign.zhibo.FeignClientForZhibo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -63,11 +64,12 @@ public class FeignService {
...
@@ -63,11 +64,12 @@ public class FeignService {
public
UserInfoResp
getUserInfoById
(
String
userId
)
{
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
(
"内部接口调用失败"
);
throw
new
BizException
(
"内部接口调用失败"
);
}
}
return
user
InfoNewCommonResp
.
getData
(
);
return
user
List
.
get
(
0
);
}
}
public
List
<
ShortVideoBaseInfoResp
>
batchGetShortVideoBaseInfo
(
List
<
String
>
sourceIds
)
{
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