using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Sanhe.Abp.Notifications;
///
/// 通知订阅管理器
///
public interface INotificationSubscriptionManager
{
///
/// 是否已订阅
///
/// 租户
/// 用户标识
/// 通知名称
///
Task IsSubscribedAsync(
Guid? tenantId,
Guid userId,
string notificationName,
CancellationToken cancellationToken = default);
///
/// 订阅通知
///
/// 租户
/// 用户标识
/// 通知名称
///
Task SubscribeAsync(
Guid? tenantId,
UserIdentifier identifier,
string notificationName,
CancellationToken cancellationToken = default);
///
/// 订阅通知
///
/// 租户
/// 用户标识列表
/// 通知名称
///
Task SubscribeAsync(
Guid? tenantId,
IEnumerable identifiers,
string notificationName,
CancellationToken cancellationToken = default);
///
/// 取消所有用户订阅
///
/// 租户
/// 通知名称
///
Task UnsubscribeAllAsync(
Guid? tenantId,
string notificationName,
CancellationToken cancellationToken = default);
///
/// 取消订阅
///
/// 租户
/// 用户标识
/// 通知名称
///
Task UnsubscribeAsync(
Guid? tenantId,
UserIdentifier identifier,
string notificationName,
CancellationToken cancellationToken = default);
///
/// 取消订阅
///
/// 租户
/// 用户标识列表
/// 通知名称
///
Task UnsubscribeAsync(
Guid? tenantId,
IEnumerable identifiers,
string notificationName,
CancellationToken cancellationToken = default);
///
/// 获取通知被订阅用户列表
///
/// 租户
/// 通知名称
/// 需要检查的用户列表
///
Task> GetUsersSubscriptionsAsync(
Guid? tenantId,
string notificationName,
IEnumerable identifiers = null,
CancellationToken cancellationToken = default);
///
/// 获取用户订阅列表
///
/// 租户
/// 用户标识
///
Task> GetUserSubscriptionsAsync(
Guid? tenantId,
Guid userId,
CancellationToken cancellationToken = default);
///
/// 获取用户订阅列表
///
/// 租户
/// 用户名
///
Task> GetUserSubscriptionsAsync(
Guid? tenantId,
string userName,
CancellationToken cancellationToken = default);
}