using Microsoft.AspNetCore.Mvc;
using QYZH.InteractiveMagazine.IService;
using QYZH.InteractiveMagazine.Models.Dto;
using QYZH.InteractiveMagazine.Models.Dto.Material;

namespace QYZH.InteractiveMagazine.WeChatApi.Controllers;

/// <summary>
/// 小程序资料控制器
/// </summary>
public class MaterialController(IMaterialService materialService) : WeChatBaseController
{
    /// <summary>
    /// 获取可见资料列表
    /// </summary>
    /// <returns>资料列表</returns>
    [HttpGet]
    public async Task<BaseResponse<List<MaterialOutput>>> GetListAsync()
    {
        var result = await materialService.GetEnabledListAsync();
        return Success(result);
    }
}
