From 1d0d45bd7ef1ec892cd5918cc65020dc59c07295 Mon Sep 17 00:00:00 2001
From: hanpaopao <510423039@qq.com>
Date: Wed, 20 Nov 2024 11:11:43 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B6=88=E6=81=AF=E6=9F=A5=E8=AF=A2?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF=E7=BA=A7=E5=88=AB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Notifications/Dtos/PagingNotificationInput.cs | 5 +++++
.../Notifications/NotificationAppService.cs | 4 ++--
.../Notifications/INotificationManager.cs | 4 +++-
.../Notifications/INotificationRepository.cs | 2 ++
.../Notifications/NotificationManager.cs | 8 +++++---
.../Notifications/EfCoreNotificationRepository.cs | 4 ++++
6 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Application.Contracts/Notifications/Dtos/PagingNotificationInput.cs b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Application.Contracts/Notifications/Dtos/PagingNotificationInput.cs
index d851adfd..b79b427b 100644
--- a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Application.Contracts/Notifications/Dtos/PagingNotificationInput.cs
+++ b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Application.Contracts/Notifications/Dtos/PagingNotificationInput.cs
@@ -52,5 +52,10 @@ namespace Lion.AbpPro.NotificationManagement.Notifications.Dtos
/// 消息类型
///
public MessageType? MessageType { get; set; }
+
+ ///
+ /// 消息等级
+ ///
+ public MessageLevel? MessageLevel { get; set; }
}
}
\ No newline at end of file
diff --git a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Application/Notifications/NotificationAppService.cs b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Application/Notifications/NotificationAppService.cs
index 7a834c94..e778f6e4 100644
--- a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Application/Notifications/NotificationAppService.cs
+++ b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Application/Notifications/NotificationAppService.cs
@@ -94,8 +94,8 @@ namespace Lion.AbpPro.NotificationManagement.Notifications
///
public virtual async Task> PageNotificationAsync(PagingNotificationInput input)
{
- var totalCount = await _notificationManager.GetPagingCountAsync(input.Title, input.Content, input.SenderUserId, input.SenderUserName, input.ReceiverUserId, input.ReceiverUserName, input.Read, input.StartReadTime, input.EndReadTime, input.MessageType);
- var list = await _notificationManager.GetPagingListAsync(input.Title, input.Content, input.SenderUserId, input.SenderUserName, input.ReceiverUserId, input.ReceiverUserName, input.Read, input.StartReadTime, input.EndReadTime, input.MessageType, input.PageSize, input.SkipCount);
+ var totalCount = await _notificationManager.GetPagingCountAsync(input.Title, input.Content, input.SenderUserId, input.SenderUserName, input.ReceiverUserId, input.ReceiverUserName, input.Read, input.StartReadTime, input.EndReadTime, input.MessageType,input.MessageLevel);
+ var list = await _notificationManager.GetPagingListAsync(input.Title, input.Content, input.SenderUserId, input.SenderUserName, input.ReceiverUserId, input.ReceiverUserName, input.Read, input.StartReadTime, input.EndReadTime, input.MessageType,input.MessageLevel, input.PageSize, input.SkipCount);
return new PagedResultDto(totalCount, ObjectMapper.Map, List>(list));
}
diff --git a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/INotificationManager.cs b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/INotificationManager.cs
index 60c5f44e..2fe25dd8 100644
--- a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/INotificationManager.cs
+++ b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/INotificationManager.cs
@@ -19,6 +19,7 @@ public interface INotificationManager
DateTime? startReadTime,
DateTime? endReadTime,
MessageType? messageType,
+ MessageLevel? messageLevel,
int maxResultCount = 10,
int skipCount = 0);
@@ -35,7 +36,8 @@ public interface INotificationManager
bool? read,
DateTime? startReadTime,
DateTime? endReadTime,
- MessageType? messageType);
+ MessageType? messageType,
+ MessageLevel? messageLevel);
///
/// 发送警告文本消息
diff --git a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/INotificationRepository.cs b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/INotificationRepository.cs
index 5dbf177a..f2ecc957 100644
--- a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/INotificationRepository.cs
+++ b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/INotificationRepository.cs
@@ -19,6 +19,7 @@ namespace Lion.AbpPro.NotificationManagement.Notifications
DateTime? startReadTime,
DateTime? endReadTime,
MessageType? messageType,
+ MessageLevel? messageLevel,
int maxResultCount = 10,
int skipCount = 0,
CancellationToken cancellationToken = default);
@@ -37,6 +38,7 @@ namespace Lion.AbpPro.NotificationManagement.Notifications
DateTime? startReadTime,
DateTime? endReadTime,
MessageType? messageType,
+ MessageLevel? messageLevel,
CancellationToken cancellationToken = default);
Task> GetListAsync(List ids);
diff --git a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/NotificationManager.cs b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/NotificationManager.cs
index 0d43a1be..25785622 100644
--- a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/NotificationManager.cs
+++ b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/NotificationManager.cs
@@ -29,10 +29,11 @@ namespace Lion.AbpPro.NotificationManagement.Notifications
DateTime? startReadTime,
DateTime? endReadTime,
MessageType? messageType,
+ MessageLevel? messageLevel,
int maxResultCount = 10,
int skipCount = 0)
{
- var list = await _notificationRepository.GetPagingListAsync(title, content, senderUserId, senderUserName, receiverUserId, receiverUserName, read, startReadTime, endReadTime, messageType, maxResultCount, skipCount);
+ var list = await _notificationRepository.GetPagingListAsync(title, content, senderUserId, senderUserName, receiverUserId, receiverUserName, read, startReadTime, endReadTime, messageType,messageLevel, maxResultCount, skipCount);
return ObjectMapper.Map, List>(list);
}
@@ -49,9 +50,10 @@ namespace Lion.AbpPro.NotificationManagement.Notifications
bool? read,
DateTime? startReadTime,
DateTime? endReadTime,
- MessageType? messageType)
+ MessageType? messageType,
+ MessageLevel? messageLevel)
{
- return await _notificationRepository.GetPagingCountAsync(title, content, senderUserId, senderUserName, receiverUserId, receiverUserName, read, startReadTime, endReadTime, messageType);
+ return await _notificationRepository.GetPagingCountAsync(title, content, senderUserId, senderUserName, receiverUserId, receiverUserName, read, startReadTime, endReadTime, messageType, messageLevel);
}
public async Task SendCommonWarningMessageAsync(string title, string content, MessageLevel level, Guid receiveUserId, string receiveUserName)
diff --git a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/Notifications/EfCoreNotificationRepository.cs b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/Notifications/EfCoreNotificationRepository.cs
index 2b625389..84e9e550 100644
--- a/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/Notifications/EfCoreNotificationRepository.cs
+++ b/aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/Notifications/EfCoreNotificationRepository.cs
@@ -23,6 +23,7 @@ namespace Lion.AbpPro.NotificationManagement.EntityFrameworkCore.Notifications
DateTime? startReadTime,
DateTime? endReadTime,
MessageType? messageType,
+ MessageLevel? messageLevel,
int maxResultCount = 10,
int skipCount = 0,
CancellationToken cancellationToken = default)
@@ -38,6 +39,7 @@ namespace Lion.AbpPro.NotificationManagement.EntityFrameworkCore.Notifications
.WhereIf(startReadTime.HasValue, e => e.ReadTime >= startReadTime.Value)
.WhereIf(endReadTime.HasValue, e => e.ReadTime <= endReadTime.Value)
.WhereIf(messageType.HasValue, e => e.MessageType == messageType.Value)
+ .WhereIf(messageLevel.HasValue, e => e.MessageLevel == messageLevel.Value)
.OrderByDescending(e => e.CreationTime)
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
@@ -54,6 +56,7 @@ namespace Lion.AbpPro.NotificationManagement.EntityFrameworkCore.Notifications
DateTime? startReadTime,
DateTime? endReadTime,
MessageType? messageType,
+ MessageLevel? messageLevel,
CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
@@ -67,6 +70,7 @@ namespace Lion.AbpPro.NotificationManagement.EntityFrameworkCore.Notifications
.WhereIf(startReadTime.HasValue, e => e.ReadTime >= startReadTime.Value)
.WhereIf(endReadTime.HasValue, e => e.ReadTime <= endReadTime.Value)
.WhereIf(messageType.HasValue, e => e.MessageType == messageType.Value)
+ .WhereIf(messageLevel.HasValue, e => e.MessageLevel == messageLevel.Value)
.CountAsync(cancellationToken);
}