2
0

INotificationsRepository.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System.Threading;
  2. using MediaBrowser.Controller.Persistence;
  3. using MediaBrowser.Model.Notifications;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Threading.Tasks;
  7. namespace MediaBrowser.Controller.Notifications
  8. {
  9. /// <summary>
  10. /// Interface INotificationsRepository
  11. /// </summary>
  12. public interface INotificationsRepository
  13. {
  14. /// <summary>
  15. /// Occurs when [notification added].
  16. /// </summary>
  17. event EventHandler<NotificationUpdateEventArgs> NotificationAdded;
  18. /// <summary>
  19. /// Occurs when [notification updated].
  20. /// </summary>
  21. event EventHandler<NotificationUpdateEventArgs> NotificationUpdated;
  22. /// <summary>
  23. /// Occurs when [notifications marked read].
  24. /// </summary>
  25. event EventHandler<NotificationReadEventArgs> NotificationsMarkedRead;
  26. /// <summary>
  27. /// Gets the notifications.
  28. /// </summary>
  29. /// <param name="query">The query.</param>
  30. /// <returns>NotificationResult.</returns>
  31. NotificationResult GetNotifications(NotificationQuery query);
  32. /// <summary>
  33. /// Gets the notification.
  34. /// </summary>
  35. /// <param name="id">The id.</param>
  36. /// <param name="userId">The user id.</param>
  37. /// <returns>Notification.</returns>
  38. Notification GetNotification(Guid id, Guid userId);
  39. /// <summary>
  40. /// Adds the notification.
  41. /// </summary>
  42. /// <param name="notification">The notification.</param>
  43. /// <param name="cancellationToken">The cancellation token.</param>
  44. /// <returns>Task.</returns>
  45. Task AddNotification(Notification notification, CancellationToken cancellationToken);
  46. /// <summary>
  47. /// Updates the notification.
  48. /// </summary>
  49. /// <param name="notification">The notification.</param>
  50. /// <param name="cancellationToken">The cancellation token.</param>
  51. /// <returns>Task.</returns>
  52. Task UpdateNotification(Notification notification, CancellationToken cancellationToken);
  53. /// <summary>
  54. /// Marks the read.
  55. /// </summary>
  56. /// <param name="notificationIdList">The notification id list.</param>
  57. /// <param name="userId">The user id.</param>
  58. /// <param name="isRead">if set to <c>true</c> [is read].</param>
  59. /// <param name="cancellationToken">The cancellation token.</param>
  60. /// <returns>Task.</returns>
  61. Task MarkRead(IEnumerable<Guid> notificationIdList, Guid userId, bool isRead, CancellationToken cancellationToken);
  62. /// <summary>
  63. /// Gets the notifications summary.
  64. /// </summary>
  65. /// <param name="userId">The user id.</param>
  66. /// <returns>NotificationsSummary.</returns>
  67. NotificationsSummary GetNotificationsSummary(Guid userId);
  68. }
  69. }