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
b79edc8a
Commit
b79edc8a
authored
Feb 23, 2022
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回复评论推送
parent
d7e1cadc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
NotifyQueryReq.java
.../community/api/beans/req/notification/NotifyQueryReq.java
+1
-1
NotificationService.java
...java/com/tanpu/community/service/NotificationService.java
+14
-7
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/req/notification/NotifyQueryReq.java
View file @
b79edc8a
...
...
@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public
class
NotifyQueryReq
{
@ApiModelProperty
(
value
=
"1:转发 2:点赞(主题点赞+评论点赞) 3:评论
4:关注
0:全部"
)
@ApiModelProperty
(
value
=
"1:转发 2:点赞(主题点赞+评论点赞) 3:评论
(评论主题+回复评论) 4:关注
0:全部"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"最后一条通知"
)
...
...
community-service/src/main/java/com/tanpu/community/service/NotificationService.java
View file @
b79edc8a
...
...
@@ -165,12 +165,19 @@ public class NotificationService {
.
eq
(
NotificationEntity:
:
getNotificationId
,
lastId
));
queryWrapper
.
lt
(
NotificationEntity:
:
getUpdateTime
,
lastOne
.
getCreateTime
());
}
if
(!
NotificationTypeEnum
.
ALL
.
getCode
().
equals
(
type
)
&&
!
NotificationTypeEnum
.
LIKE
.
getCode
().
equals
(
type
))
{
queryWrapper
.
eq
(
NotificationEntity:
:
getMessageType
,
type
);
}
else
if
(
NotificationTypeEnum
.
LIKE
.
getCode
().
equals
(
type
))
{
if
(!
NotificationTypeEnum
.
ALL
.
getCode
().
equals
(
type
))
{
if
(
NotificationTypeEnum
.
LIKE
.
getCode
().
equals
(
type
))
{
// 类型2点赞返回评论点赞和主题点赞
queryWrapper
.
in
(
NotificationEntity:
:
getMessageType
,
Arrays
.
asList
(
NotificationTypeEnum
.
LIKE
.
getCode
(),
NotificationTypeEnum
.
COMMENT_LIKE
.
getCode
()));
}
else
if
(!
NotificationTypeEnum
.
COMMENT
.
getCode
().
equals
(
type
))
{
// 类型3返回 回复主题和回复评论
queryWrapper
.
in
(
NotificationEntity:
:
getMessageType
,
Arrays
.
asList
(
NotificationTypeEnum
.
COMMENT
.
getCode
(),
NotificationTypeEnum
.
COMMENT_REPLY
.
getCode
()));
}
else
{
queryWrapper
.
eq
(
NotificationEntity:
:
getMessageType
,
type
);
}
}
return
notificationMapper
.
selectList
(
queryWrapper
);
}
...
...
@@ -239,7 +246,7 @@ public class NotificationService {
NotificationEntity
last
=
notificationMapper
.
selectOne
(
new
LambdaQueryWrapper
<
NotificationEntity
>().
eq
(
NotificationEntity:
:
getNotifiedUserId
,
notifyUserId
)
.
orderByDesc
(
NotificationEntity:
:
getUpdateTime
)
.
last
(
"limit 1"
));
if
(
commentNotify
==
null
||
last
==
null
)
{
if
(
commentNotify
==
null
||
last
==
null
)
{
return
;
}
notificationMapper
.
deleteById
(
commentNotify
.
getId
());
...
...
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