Skip to content

Commit

Permalink
fix(notifications): 修复删除消息时无效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
colinin committed Aug 23, 2024
1 parent 15e571a commit 535dc8d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class AbpNotificationsApplicationAutoMapperProfile : Profile
public AbpNotificationsApplicationAutoMapperProfile()
{
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.Data, map => map.MapFrom((src, nfi) =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public AbpNotificationsDomainAutoMapperProfile()
}));

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.Lifetime, map => map.Ignore())
.ForMember(dto => dto.Type, map => map.MapFrom(src => src.Type))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class UserNotificationInfo
public Guid? TenantId { get; set; }
public string Name { get; set; }
public long Id { get; set; }
public long NotificationId { get; set; }
public ExtraPropertyDictionary ExtraProperties { get; set; }
public string NotificationTypeName { get; set; }
public DateTime CreationTime { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ on un.NotificationId equals n.NotificationId
where n.NotificationId.Equals(notificationId)
select new UserNotificationInfo
{
Id = n.NotificationId,
Id = un.Id,
NotificationId = n.NotificationId,
TenantId = n.TenantId,
Name = n.NotificationName,
ExtraProperties = n.ExtraProperties,
Expand Down Expand Up @@ -89,7 +90,7 @@ join n in dbContext.Set<Notification>()
on un.NotificationId equals n.NotificationId
select new UserNotificationInfo
{
Id = n.NotificationId,
NotificationId = n.NotificationId,
TenantId = n.TenantId,
Name = n.NotificationName,
ExtraProperties = n.ExtraProperties,
Expand Down Expand Up @@ -121,7 +122,7 @@ on un.NotificationId equals n.NotificationId
where un.UserId == userId
select new UserNotificationInfo
{
Id = n.NotificationId,
NotificationId = n.NotificationId,
TenantId = n.TenantId,
Name = n.NotificationName,
ExtraProperties = n.ExtraProperties,
Expand Down Expand Up @@ -170,7 +171,7 @@ on un.NotificationId equals n.NotificationId
where un.UserId == userId
select new UserNotificationInfo
{
Id = n.NotificationId,
NotificationId = n.NotificationId,
TenantId = n.TenantId,
Name = n.NotificationName,
ExtraProperties = n.ExtraProperties,
Expand Down

0 comments on commit 535dc8d

Please sign in to comment.