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

LogOperateController.cs 1.8 KiB

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