平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LogVisitController.cs 1.5 KiB

4 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. 
  2. //
  3. namespace SafeCampus.Web.Core;
  4. /// <summary>
  5. /// 访问日志控制器
  6. /// </summary>
  7. [ApiDescriptionSettings(Tag = "访问日志")]
  8. [Route("sys/audit/[controller]")]
  9. [SuperAdmin]
  10. public class LogVisitController : BaseController
  11. {
  12. private readonly IVisitLogService _visitLogService;
  13. public LogVisitController(IVisitLogService visitLogService)
  14. {
  15. _visitLogService = visitLogService;
  16. }
  17. /// <summary>
  18. /// 访问日志分页查询
  19. /// </summary>
  20. /// <param name="input"></param>
  21. /// <returns></returns>
  22. [HttpGet("page")]
  23. public async Task<dynamic> Page([FromQuery] VisitLogPageInput input)
  24. {
  25. return await _visitLogService.Page(input);
  26. }
  27. /// <summary>
  28. /// 访问日志周统计折线图
  29. /// </summary>
  30. /// <returns></returns>
  31. [HttpGet("lineChartData")]
  32. public async Task<dynamic> LineChartData()
  33. {
  34. return await _visitLogService.StatisticsByDay(7);
  35. }
  36. /// <summary>
  37. /// 访问日志总览饼图
  38. /// </summary>
  39. /// <returns></returns>
  40. [HttpGet("pieChartData")]
  41. public async Task<dynamic> PieChartData()
  42. {
  43. return await _visitLogService.TotalCount();
  44. }
  45. /// <summary>
  46. /// 清空日志
  47. /// </summary>
  48. /// <param name="input"></param>
  49. /// <returns></returns>
  50. [HttpPost("delete")]
  51. public async Task Delete([FromBody] VisitLogDeleteInput input)
  52. {
  53. await _visitLogService.Delete(input.Category);
  54. }
  55. }