ArticleGroupController.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using GxPress.Auth;
  4. using GxPress.Entity;
  5. using GxPress.Repository.Interface;
  6. using GxPress.Request.ArticleGroup;
  7. using GxPress.Result.ArticleGroupUser;
  8. using Microsoft.AspNetCore.Authorization;
  9. using Microsoft.AspNetCore.Mvc;
  10. namespace GxPress.Api.AppControllers
  11. {
  12. /// <summary>
  13. /// 文章组
  14. /// </summary>
  15. [Route("api/app/article-group")]
  16. [ApiController]
  17. [Authorize]
  18. public class ArticleGroupController : Controller
  19. {
  20. private readonly IArticleGroupRepository _processGroupRepository;
  21. private readonly ILoginContext _loginContext;
  22. public ArticleGroupController(IArticleGroupRepository processGroupRepository, ILoginContext loginContext)
  23. {
  24. _processGroupRepository = processGroupRepository;
  25. _loginContext = loginContext;
  26. }
  27. /// <summary>
  28. /// 列表
  29. /// </summary>
  30. /// <returns></returns>
  31. [HttpGet("list")]
  32. public async Task<IEnumerable<ArticleGroupUserListResult>> GetList()
  33. {
  34. return await _processGroupRepository.GetListAsync(_loginContext.AccountId);
  35. }
  36. }
  37. }