diff --git a/Sanhe.Abp.Framework.sln b/Sanhe.Abp.Framework.sln index fcff7c6..7c6436a 100644 --- a/Sanhe.Abp.Framework.sln +++ b/Sanhe.Abp.Framework.sln @@ -131,8 +131,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sanhe.Abp.Auditing.Applicat EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sanhe.Abp.Auditing.HttpApi", "modules\auditing\Sanhe.Abp.Auditing.HttpApi\Sanhe.Abp.Auditing.HttpApi.csproj", "{A82C2175-AD0D-4AF5-B4F9-E264E47617C3}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "file", "file", "{9B6733E6-5B06-42B2-A92E-519C5CDCB3A6}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -394,7 +392,6 @@ Global {D014ED3D-E73A-4AFB-873E-C50B81493C8B} = {5BD41DAA-FBB1-4F52-A5D5-3C1D6A123645} {58BE1EAE-9C41-4ED4-B4B9-4F8052B3E9D7} = {5BD41DAA-FBB1-4F52-A5D5-3C1D6A123645} {A82C2175-AD0D-4AF5-B4F9-E264E47617C3} = {5BD41DAA-FBB1-4F52-A5D5-3C1D6A123645} - {9B6733E6-5B06-42B2-A92E-519C5CDCB3A6} = {F5F5D604-531B-4B57-A88E-C9C5CEEC55D7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {AB69BFDE-9DDB-4D16-8CB8-72472C0319CD} diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogActionDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogActionDto.cs index 44799f4..8769d03 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogActionDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogActionDto.cs @@ -5,14 +5,25 @@ namespace Sanhe.Abp.Auditing.AuditLogs { public class AuditLogActionDto : ExtensibleEntityDto { + /// + /// 服务名称 + /// public string ServiceName { get; set; } - + /// + /// 方法名称 + /// public string MethodName { get; set; } - + /// + /// 参数列表 + /// public string Parameters { get; set; } - + /// + /// 调用时间 + /// public DateTime ExecutionTime { get; set; } - + /// + /// 响应时间(ms) + /// public int ExecutionDuration { get; set; } } } diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogDto.cs index 34b0dfc..e678bdc 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogDto.cs @@ -6,43 +6,85 @@ namespace Sanhe.Abp.Auditing.AuditLogs { public class AuditLogDto : ExtensibleEntityDto { + /// + /// 应用名称 + /// public string ApplicationName { get; set; } - + /// + /// 用户Id + /// public Guid? UserId { get; set; } - + /// + /// 用户名称 + /// public string UserName { get; set; } - + /// + /// 租户Id + /// public Guid? TenantId { get; set; } - + /// + /// 租户名称 + /// public string TenantName { get; set; } - + /// + /// 模拟用户Id + /// public Guid? ImpersonatorUserId { get; set; } - + /// + /// 模拟租户Id + /// public Guid? ImpersonatorTenantId { get; set; } - + /// + /// 调用时间 + /// public DateTime ExecutionTime { get; set; } - + /// + /// 响应时间(ms) + /// public int ExecutionDuration { get; set; } - + /// + /// 客户端Ip地址 + /// public string ClientIpAddress { get; set; } - + /// + /// 客户端名称 + /// public string ClientName { get; set; } - + /// + /// 客户端Id + /// public string ClientId { get; set; } - + /// + /// 链路标识 + /// public string CorrelationId { get; set; } - + /// + /// 浏览器信息 + /// public string BrowserInfo { get; set; } - + /// + /// Http方法 + /// public string HttpMethod { get; set; } - + /// + /// Url + /// public string Url { get; set; } - + /// + /// 异常 + /// public string Exceptions { get; set; } - + /// + /// 评论 + /// public string Comments { get; set; } - + /// + /// Http状态码 + /// public int? HttpStatusCode { get; set; } + /// + /// 实体变更 + /// public List EntityChanges { get; set; } public List Actions { get; set; } diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs index 491b4aa..c19e074 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs @@ -6,19 +6,61 @@ namespace Sanhe.Abp.Auditing.AuditLogs { public class AuditLogGetByPagedDto : PagedAndSortedResultRequestDto { + /// + /// 开始时间 + /// public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// public DateTime? EndTime { get; set; } + /// + /// 请求方法 + /// public string HttpMethod { get; set; } + /// + /// Url + /// public string Url { get; set; } + /// + /// 用户Id + /// public Guid? UserId { get; set; } + /// + /// 用户名称 + /// public string UserName { get; set; } + /// + /// 应用名称 + /// public string ApplicationName { get; set; } + /// + /// 链路标识 + /// public string CorrelationId { get; set; } + /// + /// 客户端Id + /// public string ClientId { get; set; } + /// + /// 客户端Ip地址 + /// public string ClientIpAddress { get; set; } + /// + /// 最长响应时间(ms) + /// public int? MaxExecutionDuration { get; set; } + /// + /// 最短响应时间(ms) + /// public int? MinExecutionDuration { get; set; } + /// + /// 包含异常 + /// public bool? HasException { get; set; } + /// + /// Http状态码 + /// public HttpStatusCode? HttpStatusCode { get; set; } } } diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeDto.cs index 793d889..e256fd4 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeDto.cs @@ -7,16 +7,29 @@ namespace Sanhe.Abp.Auditing.AuditLogs { public class EntityChangeDto : ExtensibleEntityDto { + /// + /// 变更时间 + /// public DateTime ChangeTime { get; set; } - + /// + /// 变更类型 + /// public EntityChangeType ChangeType { get; set; } - + /// + /// 实体租户Id + /// public Guid? EntityTenantId { get; set; } - + /// + /// 实体标识 + /// public string EntityId { get; set; } - + /// + /// 实体类型 + /// public string EntityTypeFullName { get; set; } - + /// + /// 属性变更 + /// public List PropertyChanges { get; set; } public EntityChangeDto() diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeGetByPagedDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeGetByPagedDto.cs index fe1ec08..fa7fc2a 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeGetByPagedDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeGetByPagedDto.cs @@ -6,10 +6,28 @@ namespace Sanhe.Abp.Auditing.AuditLogs; public class EntityChangeGetByPagedDto : PagedAndSortedResultRequestDto { + /// + /// 审计日志Id + /// public Guid? AuditLogId { get; set; } + /// + /// 开始时间 + /// public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// public DateTime? EndTime { get; set; } + /// + /// 变更类型 + /// public EntityChangeType? ChangeType { get; set; } + /// + /// 实体标识 + /// public string EntityId { get; set; } + /// + /// 实体类型 + /// public string EntityTypeFullName { get; set; } } diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeGetWithUsernameDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeGetWithUsernameDto.cs index 9af2eb6..ddd28d6 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeGetWithUsernameDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeGetWithUsernameDto.cs @@ -2,6 +2,12 @@ public class EntityChangeGetWithUsernameDto { + /// + /// 实体标识 + /// public string EntityId { get; set; } + /// + /// 实体类型 + /// public string EntityTypeFullName { get; set; } } diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeWithUsernameDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeWithUsernameDto.cs index b3ed608..8c966aa 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeWithUsernameDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityChangeWithUsernameDto.cs @@ -2,7 +2,12 @@ public class EntityChangeWithUsernameDto { + /// + /// 实体变更 + /// public EntityChangeDto EntityChange { get; set; } - + /// + /// 用户名称 + /// public string UserName { get; set; } } diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs index 497597d..822dce8 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs @@ -5,12 +5,21 @@ namespace Sanhe.Abp.Auditing.AuditLogs { public class EntityPropertyChangeDto : EntityDto { + /// + /// 当前值 + /// public string NewValue { get; set; } - + /// + /// 原始值 + /// public string OriginalValue { get; set; } - + /// + /// 属性名称 + /// public string PropertyName { get; set; } - + /// + /// 属性类型 + /// public string PropertyTypeFullName { get; set; } } } diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogExceptionDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogExceptionDto.cs deleted file mode 100644 index c4632c8..0000000 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogExceptionDto.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Sanhe.Abp.Auditing.Logging.Dto -{ - public class LogExceptionDto - { - public int Depth { get; set; } - public string Class { get; set; } - public string Message { get; set; } - public string Source { get; set; } - public string StackTrace { get; set; } - public int HResult { get; set; } - public string HelpURL { get; set; } - } -} diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogFieldDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogFieldDto.cs deleted file mode 100644 index f23d5e6..0000000 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogFieldDto.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Sanhe.Abp.Auditing.Logging.Dto -{ - public class LogFieldDto - { - public string Id { get; set; } - public string MachineName { get; set; } - public string Environment { get; set; } - public string Application { get; set; } - public string Context { get; set; } - public string ActionId { get; set; } - public string ActionName { get; set; } - public string RequestId { get; set; } - public string RequestPath { get; set; } - public string ConnectionId { get; set; } - public string CorrelationId { get; set; } - public string ClientId { get; set; } - public string UserId { get; set; } - public int ProcessId { get; set; } - public int ThreadId { get; set; } - } -} diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs deleted file mode 100644 index 0589eb2..0000000 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Extensions.Logging; -using System; -using Volo.Abp.Application.Dtos; - -namespace Sanhe.Abp.Auditing.Logging.Dto -{ - public class LogGetByPagedDto : PagedAndSortedResultRequestDto - { - public DateTime? StartTime { get; set; } - public DateTime? EndTime { get; set; } - public LogLevel? Level { get; set; } - public string MachineName { get; set; } - public string Environment { get; set; } - public string Application { get; set; } - public string Context { get; set; } - public string RequestId { get; set; } - public string RequestPath { get; set; } - public string CorrelationId { get; set; } - public int? ProcessId { get; set; } - public int? ThreadId { get; set; } - public bool? HasException { get; set; } - } -} diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/ILogAppService.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/ILogAppService.cs index 56b429d..a90c921 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/ILogAppService.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/ILogAppService.cs @@ -1,5 +1,4 @@ -using Sanhe.Abp.Auditing.Logging.Dto; -using System.Threading.Tasks; +using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogDto.cs similarity index 50% rename from modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogDto.cs rename to modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogDto.cs index 4511194..435f6c5 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/Dto/LogDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogDto.cs @@ -2,14 +2,29 @@ using System; using System.Collections.Generic; -namespace Sanhe.Abp.Auditing.Logging.Dto +namespace Sanhe.Abp.Auditing.Logging { public class LogDto { + /// + /// 时间戳 + /// public DateTime TimeStamp { get; set; } + /// + /// 日志级别 + /// public LogLevel Level { get; set; } + /// + /// 信息 + /// public string Message { get; set; } + /// + /// 字段 + /// public LogFieldDto Fields { get; set; } + /// + /// 错误信息 + /// public List Exceptions { get; set; } } } diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogExceptionDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogExceptionDto.cs new file mode 100644 index 0000000..b588739 --- /dev/null +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogExceptionDto.cs @@ -0,0 +1,34 @@ +namespace Sanhe.Abp.Auditing.Logging +{ + public class LogExceptionDto + { + /// + /// 深度 + /// + public int Depth { get; set; } + /// + /// 类型 + /// + public string Class { get; set; } + /// + /// 消息 + /// + public string Message { get; set; } + /// + /// 来源 + /// + public string Source { get; set; } + /// + /// 堆栈 + /// + public string StackTrace { get; set; } + /// + /// 代码 + /// + public int HResult { get; set; } + /// + /// 帮助 + /// + public string HelpURL { get; set; } + } +} diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogFieldDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogFieldDto.cs new file mode 100644 index 0000000..aba4a13 --- /dev/null +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogFieldDto.cs @@ -0,0 +1,66 @@ +namespace Sanhe.Abp.Auditing.Logging +{ + public class LogFieldDto + { + /// + /// Id + /// + public string Id { get; set; } + /// + /// 机器名称 + /// + public string MachineName { get; set; } + /// + /// 应用环境 + /// + public string Environment { get; set; } + /// + /// 应用信息 + /// + public string Application { get; set; } + /// + /// 上下文 + /// + public string Context { get; set; } + /// + /// 方法标识 + /// + public string ActionId { get; set; } + /// + /// 方法名称 + /// + public string ActionName { get; set; } + /// + /// 请求标识 + /// + public string RequestId { get; set; } + /// + /// 请求路径 + /// + public string RequestPath { get; set; } + /// + /// 连接标识 + /// + public string ConnectionId { get; set; } + /// + /// 链路标识 + /// + public string CorrelationId { get; set; } + /// + /// 客户端标识 + /// + public string ClientId { get; set; } + /// + /// 用户标识 + /// + public string UserId { get; set; } + /// + /// 进程标识 + /// + public int ProcessId { get; set; } + /// + /// 线程标识 + /// + public int ThreadId { get; set; } + } +} diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogGetByPagedDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogGetByPagedDto.cs new file mode 100644 index 0000000..0499f37 --- /dev/null +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/Logging/LogGetByPagedDto.cs @@ -0,0 +1,62 @@ +using Microsoft.Extensions.Logging; +using System; +using Volo.Abp.Application.Dtos; + +namespace Sanhe.Abp.Auditing.Logging +{ + public class LogGetByPagedDto : PagedAndSortedResultRequestDto + { + /// + /// 开始时间 + /// + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + public DateTime? EndTime { get; set; } + /// + /// 日志等级 + /// + public LogLevel? Level { get; set; } + /// + /// 机器名称 + /// + public string MachineName { get; set; } + /// + /// 应用环境 + /// + public string Environment { get; set; } + /// + /// 应用信息 + /// + public string Application { get; set; } + /// + /// 上下文 + /// + public string Context { get; set; } + /// + /// 请求标识 + /// + public string RequestId { get; set; } + /// + /// 请求路径 + /// + public string RequestPath { get; set; } + /// + /// 链路标识 + /// + public string CorrelationId { get; set; } + /// + /// 进程标识 + /// + public int? ProcessId { get; set; } + /// + /// 线程标识 + /// + public int? ThreadId { get; set; } + /// + /// 包含异常 + /// + public bool? HasException { get; set; } + } +} diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/SecurityLogs/SecurityLogDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/SecurityLogs/SecurityLogDto.cs index f4c4a13..1e15c31 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/SecurityLogs/SecurityLogDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/SecurityLogs/SecurityLogDto.cs @@ -5,26 +5,49 @@ namespace Sanhe.Abp.Auditing.SecurityLogs { public class SecurityLogDto : ExtensibleEntityDto { + /// + /// 应用名称 + /// public string ApplicationName { get; set; } - + /// + /// 标识 + /// public string Identity { get; set; } - + /// + /// 操作 + /// public string Action { get; set; } - + /// + /// 用户Id + /// public Guid? UserId { get; set; } - + /// + /// 用户名称 + /// public string UserName { get; set; } - + /// + /// 租户名称 + /// public string TenantName { get; set; } - + /// + /// 客户端Id + /// public string ClientId { get; set; } - + /// + /// 链路标识 + /// public string CorrelationId { get; set; } - + /// + /// 客户端地址 + /// public string ClientIpAddress { get; set; } - + /// + /// 浏览器信息 + /// public string BrowserInfo { get; set; } - + /// + /// 创建时间 + /// public DateTime CreationTime { get; set; } } } diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs index 4919af7..a312d2c 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application.Contracts/Sanhe/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs @@ -5,14 +5,41 @@ namespace Sanhe.Abp.Auditing.SecurityLogs { public class SecurityLogGetByPagedDto : PagedAndSortedResultRequestDto { + /// + /// 开始时间 + /// public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// public DateTime? EndTime { get; set; } + /// + /// 应用名称 + /// public string ApplicationName { get; set; } + /// + /// 标识 + /// public string Identity { get; set; } + /// + /// 方法名称 + /// public string ActionName { get; set; } + /// + /// 用户Id + /// public Guid? UserId { get; set; } + /// + /// 用户名称 + /// public string UserName { get; set; } + /// + /// 客户端Id + /// public string ClientId { get; set; } + /// + /// 链路标识 + /// public string CorrelationId { get; set; } } } diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application/Sanhe/Abp/Auditing/AbpAuditingMapperProfile.cs b/modules/auditing/Sanhe.Abp.Auditing.Application/Sanhe/Abp/Auditing/AbpAuditingMapperProfile.cs index a5b8f59..2cdc2e8 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application/Sanhe/Abp/Auditing/AbpAuditingMapperProfile.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application/Sanhe/Abp/Auditing/AbpAuditingMapperProfile.cs @@ -1,6 +1,6 @@ using AutoMapper; using Sanhe.Abp.Auditing.AuditLogs; -using Sanhe.Abp.Auditing.Logging.Dto; +using Sanhe.Abp.Auditing.Logging; using Sanhe.Abp.Auditing.SecurityLogs; using Sanhe.Abp.AuditLogging; using Sanhe.Abp.Logging; diff --git a/modules/auditing/Sanhe.Abp.Auditing.Application/Sanhe/Abp/Auditing/Logging/LogAppService.cs b/modules/auditing/Sanhe.Abp.Auditing.Application/Sanhe/Abp/Auditing/Logging/LogAppService.cs index c4a90f1..8ba112c 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.Application/Sanhe/Abp/Auditing/Logging/LogAppService.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.Application/Sanhe/Abp/Auditing/Logging/LogAppService.cs @@ -1,5 +1,4 @@ -using Sanhe.Abp.Auditing.Logging.Dto; -using Sanhe.Abp.Logging; +using Sanhe.Abp.Logging; using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; diff --git a/modules/auditing/Sanhe.Abp.Auditing.HttpApi/Sanhe/Abp/Auditing/Logging/LogController.cs b/modules/auditing/Sanhe.Abp.Auditing.HttpApi/Sanhe/Abp/Auditing/Logging/LogController.cs index 1440ec3..0ee4d41 100644 --- a/modules/auditing/Sanhe.Abp.Auditing.HttpApi/Sanhe/Abp/Auditing/Logging/LogController.cs +++ b/modules/auditing/Sanhe.Abp.Auditing.HttpApi/Sanhe/Abp/Auditing/Logging/LogController.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using Sanhe.Abp.Auditing.Logging.Dto; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; diff --git a/modules/common/Sanhe.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs b/modules/common/Sanhe.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs deleted file mode 100644 index 3478489..0000000 --- a/modules/common/Sanhe.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System; -using System.ComponentModel; -using System.Reflection; - -namespace Volo.Abp.EntityFrameworkCore.Modeling; - -public static class AbpEntityTypeBuilderExtensions -{ - public static void ConfigureCommentByDisplayName(this EntityTypeBuilder builder) where T : class - { - Check.NotNull(builder, nameof(builder)); - Type type = typeof(T); - PropertyInfo[] properties = type.GetProperties(); - foreach (PropertyInfo propertyInfo in properties) - { - string text = propertyInfo.GetCustomAttribute()?.DisplayName; - if (!string.IsNullOrEmpty(text)) - { - builder.Property(propertyInfo.Name).HasComment(text); - } - } - builder.HasComment(type.GetCustomAttribute()?.DisplayName); - } -} diff --git a/modules/common/Sanhe.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/EntityTypeBuilderExtensions.cs b/modules/common/Sanhe.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/EntityTypeBuilderExtensions.cs new file mode 100644 index 0000000..1cae353 --- /dev/null +++ b/modules/common/Sanhe.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/EntityTypeBuilderExtensions.cs @@ -0,0 +1,90 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using System; +using System.ComponentModel; +using System.Reflection; +using Volo.Abp.Auditing; +using Volo.Abp.Data; +using Volo.Abp.Domain.Entities; +using Volo.Abp.MultiTenancy; + +namespace Volo.Abp.EntityFrameworkCore.Modeling; + +public static class EntityTypeBuilderExtensions +{ + /// + /// 根据设置字段注释。 + /// + /// 实体 + /// + public static void ConfigureCommentByDisplayName(this EntityTypeBuilder builder) where T : class + { + Check.NotNull(builder, nameof(builder)); + var type = typeof(T); + var properties = type.GetProperties(); + foreach (var propertyInfo in properties) + { + var text = propertyInfo.GetCustomAttribute()?.DisplayName; + if (!string.IsNullOrEmpty(text)) + { + builder.Property(propertyInfo.Name).HasComment(text); + } + } + builder.HasComment(type.GetCustomAttribute()?.DisplayName); + } + + public static void ConfigureByConventionWithChineseComment(this EntityTypeBuilder b) + { + AbpEntityTypeBuilderExtensions.ConfigureByConvention(b); + + if (b.Metadata.ClrType.IsAssignableTo()) + { + b.Property(nameof(IHasConcurrencyStamp.ConcurrencyStamp)).HasComment("并发标识"); + } + + if (b.Metadata.ClrType.IsAssignableTo()) + { + b.Property(nameof(IHasExtraProperties.ExtraProperties)).HasComment("扩展属性"); + } + + if (b.Metadata.ClrType.IsAssignableTo()) + { + b.Property(nameof(IMayHaveCreator.CreatorId)).HasComment("创建人Id"); + } + + if (b.Metadata.ClrType.IsAssignableTo()) + { + b.Property(nameof(ISoftDelete.IsDeleted)).HasComment("是否删除"); + } + + if (b.Metadata.ClrType.IsAssignableTo()) + { + b.Property(nameof(IHasDeletionTime.DeletionTime)).HasComment("删除时间"); + } + + if (b.Metadata.ClrType.IsAssignableTo()) + { + b.Property(nameof(IDeletionAuditedObject.DeleterId)).HasComment("删除人Id"); + } + + if (b.Metadata.ClrType.IsAssignableTo()) + { + b.Property(nameof(IHasCreationTime.CreationTime)).HasComment("创建时间"); + } + + if (b.Metadata.ClrType.IsAssignableTo()) + { + b.Property(nameof(IHasModificationTime.LastModificationTime)).HasComment("修改时间"); + } + + if (b.Metadata.ClrType.IsAssignableTo()) + { + b.Property(nameof(IModificationAuditedObject.LastModifierId)).HasComment("最后修改人Id"); + } + + if (b.Metadata.ClrType.IsAssignableTo()) + { + b.Property(nameof(IMultiTenant.TenantId)).HasComment("租户Id"); + } + } +} diff --git a/modules/common/Sanhe.Abp.Features.LimitValidation/Sanhe/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs b/modules/common/Sanhe.Abp.Features.LimitValidation/Sanhe/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs index 007a460..f94e389 100644 --- a/modules/common/Sanhe.Abp.Features.LimitValidation/Sanhe/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs +++ b/modules/common/Sanhe.Abp.Features.LimitValidation/Sanhe/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs @@ -55,7 +55,6 @@ public class FeaturesLimitValidationInterceptor : AbpInterceptor, ITransientDepe // 执行代理方法 await invocation.ProceedAsync(); // 调用次数递增 - // TODO: 使用Redis结合Lua脚本? await PostCheckFeatureAsync(limitFeatureContext); }