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

81 lines
1.8 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 LogOperateController : BaseController
  10. {
  11. private readonly IOperateLogService _operateLogService;
  12. public LogOperateController(IOperateLogService operateLogService)
  13. {
  14. _operateLogService = operateLogService;
  15. }
  16. /// <summary>
  17. /// 操作日志分页查询
  18. /// </summary>
  19. /// <param name="input"></param>
  20. /// <returns></returns>
  21. [HttpGet("page")]
  22. public async Task<dynamic> Page([FromQuery] OperateLogPageInput input)
  23. {
  24. return await _operateLogService.Page(input);
  25. }
  26. /// <summary>
  27. /// 操作日志周统计柱状图图
  28. /// </summary>
  29. /// <returns></returns>
  30. [HttpGet("columnChartData")]
  31. public async Task<dynamic> BarChartData()
  32. {
  33. return await _operateLogService.StatisticsByDay(7);
  34. }
  35. /// <summary>
  36. /// 操作日志数量总览饼图
  37. /// </summary>
  38. /// <returns></returns>
  39. [HttpGet("pieChartData")]
  40. public async Task<dynamic> PieChartData()
  41. {
  42. return await _operateLogService.TotalCount();
  43. }
  44. /// <summary>
  45. /// 清空日志
  46. /// </summary>
  47. /// <param name="input"></param>
  48. /// <returns></returns>
  49. [HttpPost("delete")]
  50. public async Task Delete([FromBody] OperateLogDeleteInput input)
  51. {
  52. await _operateLogService.Delete(input.Category);
  53. }
  54. /// <summary>
  55. /// 日志详情
  56. /// </summary>
  57. /// <param name="input"></param>
  58. /// <returns></returns>
  59. [HttpGet("detail")]
  60. public async Task<dynamic> Detail([FromQuery] BaseIdInput input)
  61. {
  62. return await _operateLogService.Detail(input);
  63. }
  64. }