平安校园
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.
 
 
 
 
 
 

70 lines
1.5 KiB

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