@@ -116,4 +116,20 @@ public class NotificationService {
|
||||
return notificationRepository.updateStatus(notificationIds, user, NotificationStatus.NEW,
|
||||
NotificationStatus.READIED, LocalDateTime.now());
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public int delete(List<Long> notificationIds) {
|
||||
if (notificationIds == null || notificationIds.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
|
||||
for (Long notificationId : notificationIds) {
|
||||
notificationRepository.deleteById(notificationId);
|
||||
count += 1;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user