- public interface IAuditLogAppService : IApplicationService
- {
- /// <summary>
- /// 大型项目的审计日志量会十分大, 所以最起码要分页
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- Task<PagedResultDto<AuditLogListDto>> GetAuditLogs(GetAuditLogsInput input);
- /// <summary>
- /// 一定要提供 Excel 下载功能, 一般建议是按照时间段选取
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- Task<FileDto> GetAuditLogsToExcel(GetAuditLogsInput input);
- /// <summary>
- /// 提供全部审计日志的 Excel 下载, 因为数据量会比较大, 需要在服务器先压缩好, 再提供给客户端下载.
- /// </summary>
- /// <returns></returns>
- Task<FileDto> GetAuditLogsToExcel();
- //List<AuditLogListDto> GetAllAuditLogs(); // 错误案例示范, 大型项目的审计日志量会十分大, 所以最起码要分页
- }
AuditLogListDto.cs
- using System;
- using Abp.Application.Services.Dto;
- using Abp.Auditing;
- using Abp.AutoMapper;
- [AutoMapFrom(typeof(AuditLog))]
- public class AuditLogListDto : EntityDto<long>
- {
- public long? UserId { get; set; }
- public string UserName { get; set; }
- public int? ImpersonatorTenantId { get; set; }
- public long? ImpersonatorUserId { get; set; }
- public string ServiceName { get; set; }
- public string MethodName { get; set; }
- public string Parameters { get; set; }
- public DateTime ExecutionTime { get; set; }
- public int ExecutionDuration { get; set; }
- public string ClientIpAddress { get; set; }
- public string ClientName { get; set; }
- public string BrowserInfo { get; set; }
- public string Exception { get; set; }
- public string CustomData { get; set; }
- }
AuditLogAppService.cs
来源: https://www.cnblogs.com/adalovelacer/p/abp-big-project-2-read-auditlog.html