2021-05-06 22:39:20 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2022-02-15 21:27:38 +00:00
|
|
|
using System;
|
2019-01-13 20:01:16 +00:00
|
|
|
using System.Collections.Generic;
|
2018-12-27 23:27:57 +00:00
|
|
|
using System.Threading;
|
2019-01-13 19:25:32 +00:00
|
|
|
using MediaBrowser.Controller.Entities;
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Persistence
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-06-15 22:37:52 +00:00
|
|
|
/// Provides an interface to implement a UserData repository.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
2022-02-15 21:27:38 +00:00
|
|
|
public interface IUserDataRepository : IDisposable
|
2018-12-27 23:27:57 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the user data.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The user id.</param>
|
|
|
|
/// <param name="key">The key.</param>
|
|
|
|
/// <param name="userData">The user data.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
void SaveUserData(long userId, string key, UserItemData userData, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the user data.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The user id.</param>
|
|
|
|
/// <param name="key">The key.</param>
|
2020-08-22 19:56:24 +00:00
|
|
|
/// <returns>The user data.</returns>
|
2018-12-27 23:27:57 +00:00
|
|
|
UserItemData GetUserData(long userId, string key);
|
|
|
|
|
2020-08-22 19:56:24 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the user data.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The user id.</param>
|
|
|
|
/// <param name="keys">The keys.</param>
|
|
|
|
/// <returns>The user data.</returns>
|
2018-12-27 23:27:57 +00:00
|
|
|
UserItemData GetUserData(long userId, List<string> keys);
|
|
|
|
|
|
|
|
/// <summary>
|
2020-06-15 22:37:52 +00:00
|
|
|
/// Return all user data associated with the given user.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
2021-06-06 15:16:41 +00:00
|
|
|
/// <param name="userId">The user id.</param>
|
|
|
|
/// <returns>The list of user item data.</returns>
|
2018-12-27 23:27:57 +00:00
|
|
|
List<UserItemData> GetAllUserData(long userId);
|
|
|
|
|
|
|
|
/// <summary>
|
2020-06-15 22:37:52 +00:00
|
|
|
/// Save all user data associated with the given user.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
2021-06-06 15:16:41 +00:00
|
|
|
/// <param name="userId">The user id.</param>
|
|
|
|
/// <param name="userData">The user item data.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2018-12-27 23:27:57 +00:00
|
|
|
void SaveAllUserData(long userId, UserItemData[] userData, CancellationToken cancellationToken);
|
|
|
|
}
|
|
|
|
}
|