using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Request.ArticleGroup;
using GxPress.Result.Media;
using GxPress.Result.SystemLabel;
using GxPress.Service.Interface.AppHomePage;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace GxPress.Api.AppControllers
{
///
/// App首页数据
///
[Route("api/app/page")]
[ApiController]
[Authorize]
public class AppPageController : Controller
{
private readonly IAppHomePageService appHomePageService;
public AppPageController(IAppHomePageService appHomePageService)
{
this.appHomePageService = appHomePageService;
}
///
/// 大咖讲座
///
///
///
[HttpPost("cathedra")]
[AllowAnonymous]
public async Task>> GetMediasByTeacherAsync(ArticleGroupRequest request)
{
if (string.IsNullOrEmpty(request.StyleCss))
throw new Common.Exceptions.BusinessException("样式未知!");
return await appHomePageService.GetMediasByTeacherAsync(request);
}
///
/// 大咖讲座分页接口
///
///
[HttpPost("cathedra-page")]
[AllowAnonymous]
public async Task> MediaCathedraResult(ArticleGroupRequest request)
{
return await appHomePageService.MediaCathedraResult(request);
}
}
}