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
4769e67a
Commit
4769e67a
authored
Jul 23, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
缓存 bugfix
parent
64eb10aa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
9 deletions
+22
-9
CommentEntity.java
...m/tanpu/community/dao/entity/community/CommentEntity.java
+12
-3
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+10
-6
No files found.
community-service/src/main/java/com/tanpu/community/dao/entity/community/CommentEntity.java
View file @
4769e67a
package
com
.
tanpu
.
community
.
dao
.
entity
.
community
;
package
com
.
tanpu
.
community
.
dao
.
entity
.
community
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
com.fasterxml.jackson.databind.annotation.JsonDeserialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer
;
import
com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
/**
* <p>
* <p>
* 评论
* 评论
...
@@ -59,8 +64,12 @@ public class CommentEntity implements Serializable {
...
@@ -59,8 +64,12 @@ public class CommentEntity implements Serializable {
@ApiModelProperty
(
value
=
"举报状态 0:未被举报 1:被举报 2:已处理"
)
@ApiModelProperty
(
value
=
"举报状态 0:未被举报 1:被举报 2:已处理"
)
private
Integer
reportStatus
;
private
Integer
reportStatus
;
@JsonDeserialize
(
using
=
LocalDateTimeDeserializer
.
class
)
@JsonSerialize
(
using
=
LocalDateTimeSerializer
.
class
)
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
@JsonDeserialize
(
using
=
LocalDateTimeDeserializer
.
class
)
@JsonSerialize
(
using
=
LocalDateTimeSerializer
.
class
)
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
private
Integer
deleteTag
;
private
Integer
deleteTag
;
...
...
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
View file @
4769e67a
...
@@ -73,12 +73,8 @@ public class CommentManager {
...
@@ -73,12 +73,8 @@ public class CommentManager {
for
(
CommentQo
commentQo
:
commentQos
)
{
for
(
CommentQo
commentQo
:
commentQos
)
{
//查询用户信息
//查询用户信息
String
authorId
=
commentQo
.
getAuthorId
();
String
authorId
=
commentQo
.
getAuthorId
();
CommonResp
<
UserInfoNew
>
userInfoNewCommonResp
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
CACGE_FEIGN_USER_INFO
,
authorId
),
UserInfoNew
userInfo
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
CACGE_FEIGN_USER_INFO
,
authorId
),
60
*
10
,
()
->
feignClientForFatools
.
queryUsersListNew
(
authorId
),
CommonResp
.
class
);
60
*
10
,
()
->
this
.
getUserInfo
(
authorId
)
,
UserInfoNew
.
class
);
if
(
userInfoNewCommonResp
.
isNotSuccess
())
{
throw
new
BizException
(
"内部接口调用失败"
);
}
UserInfoNew
userInfo
=
userInfoNewCommonResp
.
getData
();
if
(
userInfo
!=
null
)
{
if
(
userInfo
!=
null
)
{
commentQo
.
setUserImg
(
userInfo
.
getHeadImageUrl
());
commentQo
.
setUserImg
(
userInfo
.
getHeadImageUrl
());
commentQo
.
setNickName
(
userInfo
.
getNickName
());
commentQo
.
setNickName
(
userInfo
.
getNickName
());
...
@@ -101,6 +97,14 @@ public class CommentManager {
...
@@ -101,6 +97,14 @@ public class CommentManager {
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
private
UserInfoNew
getUserInfo
(
String
authorId
){
CommonResp
<
UserInfoNew
>
userInfoNewCommonResp
=
feignClientForFatools
.
queryUsersListNew
(
authorId
);
if
(
userInfoNewCommonResp
.
isNotSuccess
())
{
throw
new
BizException
(
"内部接口调用失败"
);
}
return
userInfoNewCommonResp
.
getData
();
}
//点赞评论/取消点赞
//点赞评论/取消点赞
public
void
likeComment
(
LikeCommentReq
req
,
String
userId
)
{
public
void
likeComment
(
LikeCommentReq
req
,
String
userId
)
{
if
(
OperationTypeEnum
.
CONFIRM
.
getCode
().
equals
(
req
.
getType
()))
{
if
(
OperationTypeEnum
.
CONFIRM
.
getCode
().
equals
(
req
.
getType
()))
{
...
...
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