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.

59 lines
1.8 KiB

2 years ago
2 years ago
  1. using Microsoft.AspNetCore.Authorization;
  2. using Microsoft.AspNetCore.Mvc;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Net;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using Volo.Abp.Application.Services;
  10. using Volo.Abp.AuditLogging;
  11. namespace Shentun.Peis.AuditLogs
  12. {
  13. [ApiExplorerSettings(GroupName = "Work")]
  14. [Authorize]
  15. public class AuditLogAppService : ApplicationService
  16. {
  17. private readonly IAuditLogRepository _repository;
  18. public AuditLogAppService(IAuditLogRepository repository)
  19. {
  20. _repository = repository;
  21. }
  22. /// <summary>
  23. /// 日志列表
  24. /// </summary>
  25. /// <param name="sorting"></param>
  26. /// <param name="maxResultCount"></param>
  27. /// <param name="skipCount"></param>
  28. /// <param name="startTime">开始时间</param>
  29. /// <param name="endTime">结束时间</param>
  30. /// <param name="userName">操作用户</param>
  31. /// <returns></returns>
  32. public async Task<List<AuditLog>> GetListAsync(string sorting = null,
  33. int maxResultCount = 50,
  34. int skipCount = 0,
  35. DateTime? startTime = null,
  36. DateTime? endTime = null,
  37. string userName = null
  38. )
  39. {
  40. return await _repository.GetListAsync(sorting, maxResultCount, skipCount, startTime, endTime, null, null, null, userName,
  41. null, null, null, null, null, null, null);
  42. }
  43. /// <summary>
  44. /// 根据ID查询信息
  45. /// </summary>
  46. /// <param name="AuditLogId">日志ID</param>
  47. /// <returns></returns>
  48. public async Task<AuditLog> GetByIdAsync(Guid AuditLogId)
  49. {
  50. return await _repository.GetAsync(AuditLogId);
  51. }
  52. }
  53. }