namespace Dpz.Core.Service.V4.Services;
public interface IMusicService
{
/// <summary>
/// 保存音乐
/// </summary>
/// <param name="upload"></param>
/// <returns></returns>
[CacheModule(Clear = true)]
Task<VmMusic?> SaveAsync(VmMusicUpload? upload);
/// <summary>
/// 获取所有分组
/// </summary>
/// <returns></returns>
[CacheModule(Expiration = ExpirationTime.Day)]
Task<ICollection<string>> GetGroupsAsync();
/// <summary>
/// 修改音乐信息
/// </summary>
/// <param name="information"></param>
/// <returns></returns>
[CacheModule(Clear = true)]
Task<VmMusic> EditMusicInformationAsync(VmEditMusicInformation information);
/// <summary>
/// 分页获取音乐信息
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="title"></param>
/// <returns></returns>
[CacheModule(Expiration = ExpirationTime.Day)]
Task<IPagedList<VmMusic>> GetPagesAsync(int pageIndex, int pageSize, string? title = null);
/// <summary>
/// 获取单个音乐信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[CacheModule(Expiration = ExpirationTime.Day)]
Task<VmMusic?> GetAsync(string id);
/// <summary>
/// 删除音乐
/// </summary>
/// <param name="id"></param>
/// <param name="deleteObjectStorage">从云储存删除</param>
/// <returns>file name</returns>
[CacheModule(Clear = true)]
Task DeleteAsync(string id, Func<VmMusic, Task> deleteObjectStorage);
/// <summary>
/// 获取最新上传的音乐
/// </summary>
/// <param name="top"></param>
/// <returns></returns>
[CacheModule(Expiration = ExpirationTime.Day)]
Task<ICollection<VmMusic>> GetTopMusicsAsync(uint top = 200);
/// <summary>
/// 获取随机分组的音乐
/// </summary>
/// <param name="top"></param>
/// <returns></returns>
[CacheModule(Expiration = ExpirationTime.Day)]
Task<ICollection<VmMusic>> GetRandomGroupMusicAsync(int top = 200);
}