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

圈子消息通知-插入

parent 1d7f74fd
...@@ -31,7 +31,9 @@ public class NotificationService { ...@@ -31,7 +31,9 @@ public class NotificationService {
.notifiedUserId(notifierId) .notifiedUserId(notifierId)
.messageType(type.getCode()) .messageType(type.getCode())
.content(content) .content(content)
.operatorId(targetId).build(); .operatorId(operatorId)
.targetId(targetId)
.build();
insert(entity); insert(entity);
} }
...@@ -64,7 +66,7 @@ public class NotificationService { ...@@ -64,7 +66,7 @@ public class NotificationService {
}else { }else {
NotificationLikeDO notificationLikeDO = new NotificationLikeDO(); NotificationLikeDO notificationLikeDO = new NotificationLikeDO();
notificationLikeDO.addItem(operatorId); notificationLikeDO.addItem(operatorId);
NotificationEntity.builder().operatorId(operatorId) NotificationEntity build = NotificationEntity.builder().operatorId(operatorId)
.notificationId(uuidGenHelper.getUuidStr()) .notificationId(uuidGenHelper.getUuidStr())
.messageType(NotificationTypeEnum.LIKE.getCode()) .messageType(NotificationTypeEnum.LIKE.getCode())
.notifiedUserId(notifierId) .notifiedUserId(notifierId)
...@@ -72,8 +74,9 @@ public class NotificationService { ...@@ -72,8 +74,9 @@ public class NotificationService {
.targetId(targetId) .targetId(targetId)
.operatorId(operatorId) .operatorId(operatorId)
.build(); .build();
insert(build);
} }
insert(entity);
} }
@Transactional @Transactional
...@@ -94,14 +97,15 @@ public class NotificationService { ...@@ -94,14 +97,15 @@ public class NotificationService {
LambdaQueryWrapper<NotificationEntity> queryWrapper = new LambdaQueryWrapper<NotificationEntity>() LambdaQueryWrapper<NotificationEntity> queryWrapper = new LambdaQueryWrapper<NotificationEntity>()
.eq(NotificationEntity::getNotifiedUserId, userId) .eq(NotificationEntity::getNotifiedUserId, userId)
.lt(NotificationEntity::getCreateTime, lastOne.getCreateTime()) .lt(NotificationEntity::getUpdateTime, lastOne.getCreateTime())
.last("limit " + pageSize); .last("limit " + pageSize);
if (!NotificationTypeEnum.ALL.getCode().equals(type)){ if (!NotificationTypeEnum.ALL.getCode().equals(type)){
queryWrapper.eq(NotificationEntity::getMessageType,type); queryWrapper.eq(NotificationEntity::getMessageType,type);
} }
return notificationMapper.selectList(queryWrapper); return notificationMapper.selectList(queryWrapper);
} }
} }
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