AppPageController.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using GxPress.Common.Page;
  4. using GxPress.Request.ArticleGroup;
  5. using GxPress.Result.Media;
  6. using GxPress.Result.SystemLabel;
  7. using GxPress.Service.Interface.AppHomePage;
  8. using Microsoft.AspNetCore.Authorization;
  9. using Microsoft.AspNetCore.Mvc;
  10. namespace GxPress.Api.AppControllers
  11. {
  12. /// <summary>
  13. /// App首页数据
  14. /// </summary>
  15. [Route("api/app/page")]
  16. [ApiController]
  17. [Authorize]
  18. public class AppPageController : Controller
  19. {
  20. private readonly IAppHomePageService appHomePageService;
  21. public AppPageController(IAppHomePageService appHomePageService)
  22. {
  23. this.appHomePageService = appHomePageService;
  24. }
  25. /// <summary>
  26. /// 大咖讲座
  27. /// </summary>
  28. /// <param name="request"></param>
  29. /// <returns></returns>
  30. [HttpPost("cathedra")]
  31. [AllowAnonymous]
  32. public async Task<List<AppLabelResult<MediaCathedraResult>>> GetMediasByTeacherAsync(ArticleGroupRequest request)
  33. {
  34. if (string.IsNullOrEmpty(request.StyleCss))
  35. throw new Common.Exceptions.BusinessException("样式未知!");
  36. return await appHomePageService.GetMediasByTeacherAsync(request);
  37. }
  38. /// <summary>
  39. /// 大咖讲座分页接口
  40. /// </summary>
  41. /// <returns></returns>
  42. [HttpPost("cathedra-page")]
  43. [AllowAnonymous]
  44. public async Task<PagedList<MediaCathedraResult>> MediaCathedraResult(ArticleGroupRequest request)
  45. {
  46. return await appHomePageService.MediaCathedraResult(request);
  47. }
  48. }
  49. }