26 lines
852 B
C#
26 lines
852 B
C#
|
|
using Microsoft.AspNetCore.Mvc;
|
||
|
|
using QYZH.InteractiveMagazine.IService;
|
||
|
|
using QYZH.InteractiveMagazine.Models.Dto;
|
||
|
|
using QYZH.InteractiveMagazine.Models.Dto.Banner;
|
||
|
|
using QYZH.InteractiveMagazine.Models.Enum;
|
||
|
|
|
||
|
|
namespace QYZH.InteractiveMagazine.WeChatApi.Controllers;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 小程序轮播图控制器
|
||
|
|
/// </summary>
|
||
|
|
public class BannerController(IBannerService bannerService) : WeChatBaseController
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 获取启用轮播图列表
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="position">展示位置</param>
|
||
|
|
/// <returns>轮播图列表</returns>
|
||
|
|
[HttpGet]
|
||
|
|
public async Task<BaseResponse<List<BannerOutput>>> GetListAsync([FromQuery] BannerPositionEnum position = BannerPositionEnum.Home)
|
||
|
|
{
|
||
|
|
var result = await bannerService.GetEnabledListAsync(position);
|
||
|
|
return Success(result);
|
||
|
|
}
|
||
|
|
}
|