forked from ddrilling/AsbCloudServer
53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
using System;
|
||
using System.Threading;
|
||
using System.Threading.Tasks;
|
||
using AsbCloudApp.Data;
|
||
|
||
namespace AsbCloudApp.Services.Notifications;
|
||
|
||
/// <summary>
|
||
/// Интерфейс для работы с уведомлениями
|
||
/// </summary>
|
||
public interface INotificationService
|
||
{
|
||
/// <summary>
|
||
/// Отправка нового уведомления
|
||
/// </summary>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="idNotificationCategory"></param>
|
||
/// <param name="title"></param>
|
||
/// <param name="message"></param>
|
||
/// <param name="timeToLife"></param>
|
||
/// <param name="notificationTransport"></param>
|
||
/// <param name="cancellationToken"></param>
|
||
/// <returns></returns>
|
||
Task NotifyAsync(int idUser,
|
||
int idNotificationCategory,
|
||
string title,
|
||
string message,
|
||
TimeSpan timeToLife,
|
||
NotificationTransport notificationTransport,
|
||
CancellationToken cancellationToken);
|
||
|
||
/// <summary>
|
||
/// Обновление уведомления
|
||
/// </summary>
|
||
/// <param name="idNotification"></param>
|
||
/// <param name="isRead"></param>
|
||
/// <param name="cancellationToken"></param>
|
||
/// <returns></returns>
|
||
Task UpdateNotificationAsync(int idNotification,
|
||
bool isRead,
|
||
CancellationToken cancellationToken);
|
||
|
||
/// <summary>
|
||
/// Отправка уведомлений, которые не были отправлены
|
||
/// </summary>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="notificationTransport"></param>
|
||
/// <param name="cancellationToken"></param>
|
||
/// <returns></returns>
|
||
Task ResendNotificationAsync(int idUser,
|
||
NotificationTransport notificationTransport,
|
||
CancellationToken cancellationToken);
|
||
} |