Commit b79edc8a authored by 刘基明's avatar 刘基明

回复评论推送

parent d7e1cadc
......@@ -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 = "最后一条通知")
......
......@@ -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)) {
// 类型2点赞返回评论点赞和主题点赞
queryWrapper.in(NotificationEntity::getMessageType,
Arrays.asList(NotificationTypeEnum.LIKE.getCode(), NotificationTypeEnum.COMMENT_LIKE.getCode()));
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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment