自定义通知存储在AspNetBoilerplate中

时间:2019-06-18 09:43:49

标签: asp.net-core aspnetboilerplate asp.net-core-signalr abp

我正在使用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)。

预先感谢

0 个答案:

没有答案