35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using LiveForum.Code.Base;
|
|
using LiveForum.IService.Others;
|
|
using LiveForum.Model.Dto.Others;
|
|
using LiveForum.Code.AttributeExtend;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace LiveForum.WebApi.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 首页弹窗相关接口
|
|
/// </summary>
|
|
/// <param name="homePopups"></param>
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
public class HomePopupsController(IHomePopupsService homePopups) : ControllerBase
|
|
{
|
|
/// <summary>
|
|
/// 获取首页弹窗
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[ResponseCacheExtend(Duration = 300)] // 5分钟缓存
|
|
public Task<BaseResponse<HomePopupDto>> GetHomePopup() => homePopups.GetHomePopup();
|
|
|
|
/// <summary>
|
|
/// 点击弹窗
|
|
/// </summary>
|
|
/// <param name="request">请求参数</param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public Task<BaseResponse<HomePopupClickRespDto>> ClickPopup([FromBody] HomePopupClickReq request) => homePopups.ClickPopup(request);
|
|
}
|
|
} |