0

我正在使用 AspNetBoilerplate 框架进行开发。

我需要自定义通知以完成以下操作

  • 如果用户在通知时登录,则发送电子邮件。
  • 在界面中向用户显示通知列表(如 facebook 中的已读/未读)。目前,通知在向用户显示后会从 apbNotifications 表中删除。

从我正在阅读的内容来看,我需要实现自己的 INotificationStore 才能实现这一目标。

但是,在创建存储库并扩展 INotificationStore 之后,我得到以下信息:

namespace ESMPortal.Notification
{
    [AbpAuthorize(PermissionNames.Pages_Roles)]
    public class NotificationAppService :  INotificationAppService
    {
        private readonly RoleManager _roleManager;
        private readonly UserManager _userManager;

        public NotificationAppService(IRepository<Role> repository, RoleManager roleManager, UserManager userManager)
        {
            _roleManager = roleManager;
            _userManager = userManager;
        }

        public Task DeleteAllUserNotificationsAsync(UserIdentifier user)
        {
            throw new NotImplementedException();
        }

        public Task DeleteNotificationAsync(NotificationInfo notification)
        {
            throw new NotImplementedException();
        }

        public Task DeleteSubscriptionAsync(UserIdentifier user, string notificationName, string entityTypeName, string entityId)
        {
            throw new NotImplementedException();
        }

        public Task DeleteUserNotificationAsync(int? tenantId, Guid userNotificationId)
        {
            throw new NotImplementedException();
        }

        public Task<ListResultDto<PermissionDto>> GetAllPermissions()
        {
            throw new NotImplementedException();
        }

        public Task<NotificationInfo> GetNotificationOrNullAsync(Guid notificationId)
        {
            throw new NotImplementedException();
        }

        public Task<GetRoleForEditOutput> GetRoleForEdit(EntityDto input)
        {
            throw new NotImplementedException();
        }

        public Task<ListResultDto<RoleListDto>> GetRolesAsync(GetRolesInput input)
        {
            throw new NotImplementedException();
        }

        public Task<List<NotificationSubscriptionInfo>> GetSubscriptionsAsync(string notificationName, string entityTypeName, string entityId)
        {
            throw new NotImplementedException();
        }

        public Task<List<NotificationSubscriptionInfo>> GetSubscriptionsAsync(int?[] tenantIds, string notificationName, string entityTypeName, string entityId)
        {
            throw new NotImplementedException();
        }

        public Task<List<NotificationSubscriptionInfo>> GetSubscriptionsAsync(UserIdentifier user)
        {
            throw new NotImplementedException();
        }

        public Task<int> GetUserNotificationCountAsync(UserIdentifier user, UserNotificationState? state = null)
        {
            throw new NotImplementedException();
        }

        public Task<List<UserNotificationInfoWithNotificationInfo>> GetUserNotificationsWithNotificationsAsync(UserIdentifier user, UserNotificationState? state = null, int skipCount = 0, int maxResultCount = int.MaxValue)
        {
            throw new NotImplementedException();
        }

        public Task<UserNotificationInfoWithNotificationInfo> GetUserNotificationWithNotificationOrNullAsync(int? tenantId, Guid userNotificationId)
        {
            throw new NotImplementedException();
        }

        public Task InsertNotificationAsync(NotificationInfo notification)
        {
            throw new NotImplementedException();
        }

        public Task InsertSubscriptionAsync(NotificationSubscriptionInfo subscription)
        {
            throw new NotImplementedException();
        }

        public Task InsertTenantNotificationAsync(TenantNotificationInfo tenantNotificationInfo)
        {
            throw new NotImplementedException();
        }

        public Task InsertUserNotificationAsync(UserNotificationInfo userNotification)
        {
            throw new NotImplementedException();
        }

        public Task<bool> IsSubscribedAsync(UserIdentifier user, string notificationName, string entityTypeName, string entityId)
        {
            throw new NotImplementedException();
        }

        public Task UpdateAllUserNotificationStatesAsync(UserIdentifier user, UserNotificationState state)
        {
            throw new NotImplementedException();
        }

        public Task UpdateUserNotificationStateAsync(int? tenantId, Guid userNotificationId, UserNotificationState state)
        {
            throw new NotImplementedException();
        }
    }
} 

我的希望是我不必完全重写通知存储,只需覆盖它的某些部分即可实现我的需要,但是根据我的理解,这似乎是不可能的。

有人可以建议一种使用当前商店实现我需要的方法,或者为我提供一个示例自定义商店,该商店使用与框架中当前实现的相同的表(abpNotification)。

提前致谢

4

0 回答 0