using QYZH.InteractiveMagazine.Models.Dto;
using QYZH.InteractiveMagazine.Models.Dto.Material;
using MaterialEntity = QYZH.InteractiveMagazine.Models.Entity.Material;

namespace QYZH.InteractiveMagazine.IService;

/// <summary>
/// 资料服务接口
/// </summary>
public interface IMaterialService : IBaseService<MaterialEntity>
{
    /// <summary>
    /// 创建资料
    /// </summary>
    /// <param name="input">资料信息</param>
    /// <returns>创建后的资料信息</returns>
    Task<MaterialOutput> CreateAsync(MaterialInput input);

    /// <summary>
    /// 更新资料
    /// </summary>
    /// <param name="id">资料ID</param>
    /// <param name="input">资料信息</param>
    /// <returns>更新后的资料信息</returns>
    Task<MaterialOutput> UpdateAsync(long id, MaterialInput input);

    /// <summary>
    /// 删除资料
    /// </summary>
    /// <param name="id">资料ID</param>
    Task DeleteAsync(long id);

    /// <summary>
    /// 根据ID获取资料
    /// </summary>
    /// <param name="id">资料ID</param>
    /// <returns>资料信息</returns>
    Task<MaterialOutput> GetByIdAsync(long id);

    /// <summary>
    /// 分页查询资料列表
    /// </summary>
    /// <param name="input">查询条件</param>
    /// <returns>分页结果</returns>
    Task<PageListModel<MaterialOutput>> GetListAsync(MaterialQueryInput input);

    /// <summary>
    /// 更新资料启用/禁用状态
    /// </summary>
    /// <param name="id">资料ID</param>
    /// <returns>操作结果</returns>
    Task<bool> UpdateStatusAsync(long id);

    /// <summary>
    /// 获取小程序可见资料列表
    /// </summary>
    /// <returns>资料列表</returns>
    Task<List<MaterialOutput>> GetEnabledListAsync();
}
