AppReportController.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using System.Threading.Tasks;
  4. using GxPress.Common.Tools;
  5. using GxPress.Entity;
  6. using GxPress.Repository.Interface.AppReport;
  7. using Microsoft.AspNetCore.Authorization;
  8. using Microsoft.AspNetCore.Mvc;
  9. namespace GxPress.Api.AppControllers
  10. {
  11. /// <summary>
  12. /// App数据报表
  13. /// </summary>
  14. [Route("api/app/app-report")]
  15. [ApiController]
  16. [Authorize]
  17. public class AppReportController : ControllerBase
  18. {
  19. private readonly IAppReportRepository _appReportRepository;
  20. public AppReportController(IAppReportRepository appReportRepository)
  21. {
  22. _appReportRepository = appReportRepository;
  23. }
  24. /// <summary>
  25. /// 查询
  26. /// </summary>
  27. /// <returns></returns>
  28. [HttpPost("list")]
  29. public async Task<IEnumerable<Entity.AppReport>> GetAppReportList()
  30. {
  31. var result = await _appReportRepository.GetAppReportListAsync();
  32. var appReportList = result as AppReport[] ?? result.ToArray();
  33. foreach (var appReport in appReportList)
  34. {
  35. appReport.IocUrl = StringUtils.AddDomain(appReport.IocUrl);
  36. }
  37. return appReportList;
  38. }
  39. }
  40. }