2019-01-13 13:01:16 -07:00
|
|
|
using System.Collections.Generic;
|
2018-12-27 16:27:57 -07:00
|
|
|
using System.Threading;
|
2019-01-13 12:25:32 -07:00
|
|
|
using MediaBrowser.Controller.Entities;
|
2018-12-27 16:27:57 -07:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Persistence
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-06-15 15:37:52 -07:00
|
|
|
/// Provides an interface to implement a UserData repository.
|
2018-12-27 16:27:57 -07:00
|
|
|
/// </summary>
|
|
|
|
public interface IUserDataRepository : IRepository
|
|
|
|
{
|
|
|
|
/// <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>
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
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 12:56:24 -07:00
|
|
|
/// <returns>The user data.</returns>
|
2018-12-27 16:27:57 -07:00
|
|
|
UserItemData GetUserData(long userId, string key);
|
|
|
|
|
2020-08-22 12:56:24 -07: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 16:27:57 -07:00
|
|
|
UserItemData GetUserData(long userId, List<string> keys);
|
|
|
|
|
|
|
|
/// <summary>
|
2020-06-15 15:37:52 -07:00
|
|
|
/// Return all user data associated with the given user.
|
2018-12-27 16:27:57 -07:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
List<UserItemData> GetAllUserData(long userId);
|
|
|
|
|
|
|
|
/// <summary>
|
2020-06-15 15:37:52 -07:00
|
|
|
/// Save all user data associated with the given user.
|
2018-12-27 16:27:57 -07:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
/// <param name="userData"></param>
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
void SaveAllUserData(long userId, UserItemData[] userData, CancellationToken cancellationToken);
|
|
|
|
}
|
|
|
|
}
|