Browse Source

fix(notifications): 修复删除消息时无效的问题

pull/994/head
colin 1 year ago
parent
commit
535dc8dda2
  1. 2
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs
  2. 2
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainAutoMapperProfile.cs
  3. 1
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserNotificationInfo.cs
  4. 9
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserNotificationRepository.cs

2
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs

@ -8,7 +8,7 @@ public class AbpNotificationsApplicationAutoMapperProfile : Profile
public AbpNotificationsApplicationAutoMapperProfile() public AbpNotificationsApplicationAutoMapperProfile()
{ {
CreateMap<UserNotificationInfo, UserNotificationDto>() CreateMap<UserNotificationInfo, UserNotificationDto>()
.ForMember(dto => dto.Id, map => map.MapFrom(src => src.Id.ToString())) .ForMember(dto => dto.Id, map => map.MapFrom(src => src.NotificationId.ToString()))
.ForMember(dto => dto.Lifetime, map => map.Ignore()) .ForMember(dto => dto.Lifetime, map => map.Ignore())
.ForMember(dto => dto.Data, map => map.MapFrom((src, nfi) => .ForMember(dto => dto.Data, map => map.MapFrom((src, nfi) =>
{ {

2
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainAutoMapperProfile.cs

@ -28,7 +28,7 @@ public class AbpNotificationsDomainAutoMapperProfile : Profile
})); }));
CreateMap<UserNotificationInfo, NotificationInfo>() CreateMap<UserNotificationInfo, NotificationInfo>()
.ForMember(dto => dto.Id, map => map.MapFrom(src => src.Id.ToString())) .ForMember(dto => dto.Id, map => map.MapFrom(src => src.NotificationId.ToString()))
.ForMember(dto => dto.Name, map => map.MapFrom(src => src.Name)) .ForMember(dto => dto.Name, map => map.MapFrom(src => src.Name))
.ForMember(dto => dto.Lifetime, map => map.Ignore()) .ForMember(dto => dto.Lifetime, map => map.Ignore())
.ForMember(dto => dto.Type, map => map.MapFrom(src => src.Type)) .ForMember(dto => dto.Type, map => map.MapFrom(src => src.Type))

1
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserNotificationInfo.cs

@ -8,6 +8,7 @@ public class UserNotificationInfo
public Guid? TenantId { get; set; } public Guid? TenantId { get; set; }
public string Name { get; set; } public string Name { get; set; }
public long Id { get; set; } public long Id { get; set; }
public long NotificationId { get; set; }
public ExtraPropertyDictionary ExtraProperties { get; set; } public ExtraPropertyDictionary ExtraProperties { get; set; }
public string NotificationTypeName { get; set; } public string NotificationTypeName { get; set; }
public DateTime CreationTime { get; set; } public DateTime CreationTime { get; set; }

9
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserNotificationRepository.cs

@ -47,7 +47,8 @@ public class EfCoreUserNotificationRepository : EfCoreRepository<INotificationsD
where n.NotificationId.Equals(notificationId) where n.NotificationId.Equals(notificationId)
select new UserNotificationInfo select new UserNotificationInfo
{ {
Id = n.NotificationId, Id = un.Id,
NotificationId = n.NotificationId,
TenantId = n.TenantId, TenantId = n.TenantId,
Name = n.NotificationName, Name = n.NotificationName,
ExtraProperties = n.ExtraProperties, ExtraProperties = n.ExtraProperties,
@ -89,7 +90,7 @@ public class EfCoreUserNotificationRepository : EfCoreRepository<INotificationsD
on un.NotificationId equals n.NotificationId on un.NotificationId equals n.NotificationId
select new UserNotificationInfo select new UserNotificationInfo
{ {
Id = n.NotificationId, NotificationId = n.NotificationId,
TenantId = n.TenantId, TenantId = n.TenantId,
Name = n.NotificationName, Name = n.NotificationName,
ExtraProperties = n.ExtraProperties, ExtraProperties = n.ExtraProperties,
@ -121,7 +122,7 @@ public class EfCoreUserNotificationRepository : EfCoreRepository<INotificationsD
where un.UserId == userId where un.UserId == userId
select new UserNotificationInfo select new UserNotificationInfo
{ {
Id = n.NotificationId, NotificationId = n.NotificationId,
TenantId = n.TenantId, TenantId = n.TenantId,
Name = n.NotificationName, Name = n.NotificationName,
ExtraProperties = n.ExtraProperties, ExtraProperties = n.ExtraProperties,
@ -170,7 +171,7 @@ public class EfCoreUserNotificationRepository : EfCoreRepository<INotificationsD
where un.UserId == userId where un.UserId == userId
select new UserNotificationInfo select new UserNotificationInfo
{ {
Id = n.NotificationId, NotificationId = n.NotificationId,
TenantId = n.TenantId, TenantId = n.TenantId,
Name = n.NotificationName, Name = n.NotificationName,
ExtraProperties = n.ExtraProperties, ExtraProperties = n.ExtraProperties,

Loading…
Cancel
Save