Example #1
0
 public async Task UnsubscribeAsync(long userId, string notificationName, EntityIdentifier entityIdentifier = null)
 {
     await _notificationStore.DeleteSubscriptionAsync(
         userId,
         notificationName,
         entityIdentifier?.Type.FullName,
         entityIdentifier?.Id.ToJsonString());
 }
Example #2
0
 public async Task UnsubscribeAsync(UserIdentifier user, string notificationName, EntityIdentifier entityIdentifier = null)
 {
     await _store.DeleteSubscriptionAsync(
         user,
         notificationName,
         entityIdentifier == null?null : entityIdentifier.Type.FullName,
         entityIdentifier == null?null : entityIdentifier.Id.ToJsonString()
         );
 }
Example #3
0
 public async Task UnsubscribeAsync(Guid userId, string notificationName, NotificationEntityIdentifier entityIdentifier = null)
 {
     await _store.DeleteSubscriptionAsync(
         userId,
         notificationName,
         entityIdentifier == null?null : entityIdentifier.Type.FullName,
         entityIdentifier == null?null : entityIdentifier.Id
         );
 }
        /// <summary>
        /// 退订通知
        /// </summary>
        /// <param name="list">=订阅通知的用户集合</param>
        /// <param name="notificationName">=通知名称</param>
        /// <returns></returns>
        public async Task DeleteSubscriptionAsync(RequestParam <List <SysUserNotification> > requestParam)
        {
            Check.NotNull(requestParam.Params, nameof(requestParam.Params));

            foreach (var user in requestParam.Params)
            {
                var userIdentifier = new UserIdentifier(AbpSession.TenantId, user.UserId.Value);
                await _notificationStore.DeleteSubscriptionAsync(userIdentifier, user.NotificationName, null, null);
            }
        }
 /// <summary>
 /// 退订通知
 /// </summary>
 /// <param name="list">=订阅通知的用户集合</param>
 /// <param name="notificationName">=通知名称</param>
 /// <returns></returns>
 public async Task DeleteSubscriptionAsync(List <long> userList, string notificationName)
 {
     if (string.IsNullOrEmpty(notificationName))
     {
         return;
     }
     foreach (var user in userList)
     {
         var userIdentifier = new UserIdentifier(AbpSession.TenantId, user);
         await _notificationStore.DeleteSubscriptionAsync(userIdentifier, notificationName, null, null);
     }
 }
Example #6
0
        public async Task UnsubscribeAsync(NotificationSubscriptionOptions options)
        {
            CheckNotificationName(options.NotificationName);

            await _store.DeleteSubscriptionAsync(options);
        }