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
c95a12cc
Commit
c95a12cc
authored
Jul 26, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的评论修复
parent
6a387d8d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+1
-1
CommentService.java
...main/java/com/tanpu/community/service/CommentService.java
+5
-4
No files found.
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
c95a12cc
...
@@ -437,7 +437,7 @@ public class ThemeManager {
...
@@ -437,7 +437,7 @@ public class ThemeManager {
List
<
ThemeQo
>
commentThemeList
=
new
ArrayList
<>();
List
<
ThemeQo
>
commentThemeList
=
new
ArrayList
<>();
List
<
ThemeEntity
>
themeEntities
;
List
<
ThemeEntity
>
themeEntities
;
//评论列表
//评论列表
List
<
CommentEntity
>
commentEntities
=
commentService
.
query
Theme
sByUserId
(
req
.
getUserId
(),
req
.
getLastId
(),
req
.
getPageSize
());
List
<
CommentEntity
>
commentEntities
=
commentService
.
query
Comment
sByUserId
(
req
.
getUserId
(),
req
.
getLastId
(),
req
.
getPageSize
());
//当前用户信息
//当前用户信息
UserInfoNew
userInfo
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
CACHE_FEIGN_USER_INFO
,
req
.
getUserId
()),
UserInfoNew
userInfo
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
CACHE_FEIGN_USER_INFO
,
req
.
getUserId
()),
60
*
10
,
()
->
this
.
getUserInfo
(
req
.
getUserId
())
,
UserInfoNew
.
class
);
60
*
10
,
()
->
this
.
getUserInfo
(
req
.
getUserId
())
,
UserInfoNew
.
class
);
...
...
community-service/src/main/java/com/tanpu/community/service/CommentService.java
View file @
c95a12cc
...
@@ -85,7 +85,7 @@ public class CommentService {
...
@@ -85,7 +85,7 @@ public class CommentService {
}
}
public
List
<
CommentEntity
>
query
Theme
sByUserId
(
String
userId
)
{
public
List
<
CommentEntity
>
query
Comment
sByUserId
(
String
userId
)
{
return
commentMapper
.
selectList
(
new
LambdaQueryWrapper
<
CommentEntity
>()
return
commentMapper
.
selectList
(
new
LambdaQueryWrapper
<
CommentEntity
>()
.
eq
(
CommentEntity:
:
getAuthorId
,
userId
)
.
eq
(
CommentEntity:
:
getAuthorId
,
userId
)
.
eq
(
CommentEntity:
:
getCommentType
,
CommentTypeEnum
.
THEME
.
getCode
())
.
eq
(
CommentEntity:
:
getCommentType
,
CommentTypeEnum
.
THEME
.
getCode
())
...
@@ -93,15 +93,16 @@ public class CommentService {
...
@@ -93,15 +93,16 @@ public class CommentService {
}
}
public
List
<
CommentEntity
>
query
ThemesByUserId
(
String
userId
,
String
lastId
,
Integer
pageSize
)
{
public
List
<
CommentEntity
>
query
CommentsByUserId
(
String
userId
,
String
lastId
,
Integer
pageSize
)
{
LambdaQueryWrapper
<
CommentEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<
CommentEntity
>()
LambdaQueryWrapper
<
CommentEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<
CommentEntity
>()
.
eq
(
CommentEntity:
:
getAuthorId
,
userId
)
.
eq
(
CommentEntity:
:
getAuthorId
,
userId
)
.
eq
(
CommentEntity:
:
getCommentType
,
CommentTypeEnum
.
THEME
.
getCode
())
.
eq
(
CommentEntity:
:
getCommentType
,
CommentTypeEnum
.
THEME
.
getCode
())
.
eq
(
CommentEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
());
.
eq
(
CommentEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
())
.
orderByDesc
(
CommentEntity:
:
getCreateTime
);
if
(
StringUtils
.
isNotEmpty
(
lastId
))
{
if
(
StringUtils
.
isNotEmpty
(
lastId
))
{
CommentEntity
commentEntity
=
commentMapper
.
selectOne
(
new
LambdaQueryWrapper
<
CommentEntity
>()
CommentEntity
commentEntity
=
commentMapper
.
selectOne
(
new
LambdaQueryWrapper
<
CommentEntity
>()
.
eq
(
CommentEntity:
:
getCommentId
,
lastId
));
.
eq
(
CommentEntity:
:
getCommentId
,
lastId
));
if
(
commentEntity
==
null
)
throw
new
BizException
(
"
主题
未找到,id:"
+
lastId
);
if
(
commentEntity
==
null
)
throw
new
BizException
(
"
评论
未找到,id:"
+
lastId
);
queryWrapper
.
lt
(
CommentEntity:
:
getUpdateTime
,
commentEntity
.
getCreateTime
());
queryWrapper
.
lt
(
CommentEntity:
:
getUpdateTime
,
commentEntity
.
getCreateTime
());
}
}
if
(
pageSize
!=
null
){
if
(
pageSize
!=
null
){
...
...
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