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
2044a293
Commit
2044a293
authored
Feb 23, 2022
by
刘基明
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2.3.1' into 'dev'
回复评论推送 See merge request
!70
parents
a6aa2aa7
b79edc8a
Hide 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 @
2044a293
...
@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
...
@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@AllArgsConstructor
public
class
NotifyQueryReq
{
public
class
NotifyQueryReq
{
@ApiModelProperty
(
value
=
"1:转发 2:点赞(主题点赞+评论点赞) 3:评论
4:关注
0:全部"
)
@ApiModelProperty
(
value
=
"1:转发 2:点赞(主题点赞+评论点赞) 3:评论
(评论主题+回复评论) 4:关注
0:全部"
)
private
Integer
type
;
private
Integer
type
;
@ApiModelProperty
(
value
=
"最后一条通知"
)
@ApiModelProperty
(
value
=
"最后一条通知"
)
...
...
community-service/src/main/java/com/tanpu/community/service/NotificationService.java
View file @
2044a293
...
@@ -165,12 +165,19 @@ public class NotificationService {
...
@@ -165,12 +165,19 @@ public class NotificationService {
.
eq
(
NotificationEntity:
:
getNotificationId
,
lastId
));
.
eq
(
NotificationEntity:
:
getNotificationId
,
lastId
));
queryWrapper
.
lt
(
NotificationEntity:
:
getUpdateTime
,
lastOne
.
getCreateTime
());
queryWrapper
.
lt
(
NotificationEntity:
:
getUpdateTime
,
lastOne
.
getCreateTime
());
}
}
if
(!
NotificationTypeEnum
.
ALL
.
getCode
().
equals
(
type
)
&&
!
NotificationTypeEnum
.
LIKE
.
getCode
().
equals
(
type
))
{
if
(!
NotificationTypeEnum
.
ALL
.
getCode
().
equals
(
type
))
{
queryWrapper
.
eq
(
NotificationEntity:
:
getMessageType
,
type
);
if
(
NotificationTypeEnum
.
LIKE
.
getCode
().
equals
(
type
))
{
}
else
if
(
NotificationTypeEnum
.
LIKE
.
getCode
().
equals
(
type
))
{
// 类型2点赞返回评论点赞和主题点赞
// 类型2点赞返回评论点赞和主题点赞
queryWrapper
.
in
(
NotificationEntity:
:
getMessageType
,
queryWrapper
.
in
(
NotificationEntity:
:
getMessageType
,
Arrays
.
asList
(
NotificationTypeEnum
.
LIKE
.
getCode
(),
NotificationTypeEnum
.
COMMENT_LIKE
.
getCode
()));
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
);
return
notificationMapper
.
selectList
(
queryWrapper
);
}
}
...
@@ -239,7 +246,7 @@ public class NotificationService {
...
@@ -239,7 +246,7 @@ public class NotificationService {
NotificationEntity
last
=
notificationMapper
.
selectOne
(
new
LambdaQueryWrapper
<
NotificationEntity
>().
eq
(
NotificationEntity:
:
getNotifiedUserId
,
notifyUserId
)
NotificationEntity
last
=
notificationMapper
.
selectOne
(
new
LambdaQueryWrapper
<
NotificationEntity
>().
eq
(
NotificationEntity:
:
getNotifiedUserId
,
notifyUserId
)
.
orderByDesc
(
NotificationEntity:
:
getUpdateTime
)
.
orderByDesc
(
NotificationEntity:
:
getUpdateTime
)
.
last
(
"limit 1"
));
.
last
(
"limit 1"
));
if
(
commentNotify
==
null
||
last
==
null
)
{
if
(
commentNotify
==
null
||
last
==
null
)
{
return
;
return
;
}
}
notificationMapper
.
deleteById
(
commentNotify
.
getId
());
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