using QYZH.InteractiveMagazine.Models.Dto;
using QYZH.InteractiveMagazine.Models.Entity;

namespace QYZH.InteractiveMagazine.IService;

/// <summary>
/// 商品服务接口
/// </summary>
public interface IProductService : IBaseService<Product>
{
    /// <summary>
    /// 创建商品
    /// </summary>
    /// <param name="input">商品输入</param>
    /// <returns>创建的商品信息</returns>
    Task<ProductOutput> CreateAsync(ProductInput input);

    /// <summary>
    /// 更新商品
    /// </summary>
    /// <param name="id">商品ID</param>
    /// <param name="input">商品输入</param>
    /// <returns>更新后的商品信息</returns>
    Task<ProductOutput> UpdateAsync(long id, ProductInput input);

    /// <summary>
    /// 删除商品（软删除）
    /// </summary>
    /// <param name="id">商品ID</param>
    Task DeleteAsync(long id);

    /// <summary>
    /// 根据ID获取商品
    /// </summary>
    /// <param name="id">商品ID</param>
    /// <returns>商品信息</returns>
    Task<ProductOutput> GetByIdAsync(long id);

    /// <summary>
    /// 分页查询商品列表
    /// </summary>
    /// <param name="input">查询条件</param>
    /// <returns>分页结果</returns>
    Task<PageListModel<ProductOutput>> GetListAsync(ProductQueryInput input);

    /// <summary>
    /// 更新商品上架/下架状态（取反）
    /// </summary>
    /// <param name="id">商品ID</param>
    Task UpdateSaleStatusAsync(long id);
}
