9 changed files with 522 additions and 0 deletions
@ -0,0 +1,48 @@ |
|||
# LINGYUN.Abp.AuditLogging.EntityFrameworkCore |
|||
|
|||
[简体中文](./README.md) | English |
|||
|
|||
EntityFrameworkCore implementation for the audit logging module. This module serves as a bridge, with the actual implementation delegated to the official ABP modules. |
|||
|
|||
## Features |
|||
|
|||
* AuditLogManager - Implements IAuditLogManager, audit logs are managed by the Volo.Abp.AuditLogging module |
|||
* SecurityLogManager - Implements ISecurityLogManager, security logs are managed by the Volo.Abp.Identity module |
|||
|
|||
## Module Dependencies |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpAuditLoggingEntityFrameworkCoreModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
## Configuration |
|||
|
|||
Please follow the configuration guidelines in the Volo.Abp.AuditLogging and Volo.Abp.Identity modules. |
|||
|
|||
## Database Configuration |
|||
|
|||
Configure the connection strings in your appsettings.json: |
|||
|
|||
```json |
|||
{ |
|||
"ConnectionStrings": { |
|||
"AbpIdentity": "Server=127.0.0.1;Database=Identity;User Id=root;Password=*", |
|||
"AbpAuditLogging": "Server=127.0.0.1;Database=AuditLogging;User Id=root;Password=*", |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## Features |
|||
|
|||
1. Audit Log Management |
|||
- Store and retrieve audit logs using EntityFrameworkCore |
|||
- Support for entity change tracking |
|||
- Integration with ABP's identity system for security logs |
|||
|
|||
2. Auto Mapping |
|||
- Automatic mapping configuration for audit log entities |
|||
- Supports custom mapping profiles through AbpAutoMapperOptions |
|||
@ -0,0 +1,59 @@ |
|||
# LINGYUN.Abp.AuditLogging |
|||
|
|||
Audit logging core module, providing basic functionality and interface definitions for audit logging. |
|||
|
|||
[简体中文](./README.md) |
|||
|
|||
## Features |
|||
|
|||
* Audit logging infrastructure |
|||
* Audit log repository interface definitions |
|||
* Audit log manager interface definitions |
|||
* Support for ignoring specific types in audit logging |
|||
|
|||
## Module Dependencies |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpAuditLoggingModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
## Configuration |
|||
|
|||
```json |
|||
{ |
|||
"Auditing": { |
|||
"IsEnabled": true, // Enable or disable audit logging |
|||
"HideErrors": true, // Hide error information in audit logs |
|||
"IsEnabledForAnonymousUsers": true, // Enable audit logging for anonymous users |
|||
"IsEnabledForGetRequests": false, // Enable audit logging for GET requests |
|||
"ApplicationName": null // Application name |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## Basic Usage |
|||
|
|||
1. Reference the module |
|||
2. Configure audit logging options |
|||
3. Implement an audit log storage provider (e.g., EntityFrameworkCore or Elasticsearch) |
|||
|
|||
## Advanced Features |
|||
|
|||
### Ignoring Specific Types |
|||
|
|||
By default, the module ignores audit logs for the following types: |
|||
* CancellationToken |
|||
* CancellationTokenSource |
|||
|
|||
You can add more types to ignore through configuration: |
|||
|
|||
```csharp |
|||
Configure<AbpAuditingOptions>(options => |
|||
{ |
|||
options.IgnoredTypes.AddIfNotContains(typeof(YourType)); |
|||
}); |
|||
``` |
|||
@ -0,0 +1,59 @@ |
|||
# LINGYUN.Abp.AuditLogging |
|||
|
|||
审计日志核心模块,提供审计日志的基础功能和接口定义。 |
|||
|
|||
[English](./README.EN.md) |
|||
|
|||
## 功能特性 |
|||
|
|||
* 审计日志基础设施 |
|||
* 审计日志仓储接口定义 |
|||
* 审计日志管理器接口定义 |
|||
* 支持忽略特定类型的审计日志记录 |
|||
|
|||
## 模块引用 |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpAuditLoggingModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
## 配置项 |
|||
|
|||
```json |
|||
{ |
|||
"Auditing": { |
|||
"IsEnabled": true, // 是否启用审计日志 |
|||
"HideErrors": true, // 是否隐藏错误信息 |
|||
"IsEnabledForAnonymousUsers": true, // 是否为匿名用户启用审计日志 |
|||
"IsEnabledForGetRequests": false, // 是否为GET请求启用审计日志 |
|||
"ApplicationName": null // 应用程序名称 |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## 基本用法 |
|||
|
|||
1. 引用模块 |
|||
2. 配置审计日志选项 |
|||
3. 实现审计日志存储提供者(例如:EntityFrameworkCore或Elasticsearch) |
|||
|
|||
## 高级功能 |
|||
|
|||
### 忽略特定类型 |
|||
|
|||
默认情况下,模块会忽略以下类型的审计日志: |
|||
* CancellationToken |
|||
* CancellationTokenSource |
|||
|
|||
你可以通过配置添加更多需要忽略的类型: |
|||
|
|||
```csharp |
|||
Configure<AbpAuditingOptions>(options => |
|||
{ |
|||
options.IgnoredTypes.AddIfNotContains(typeof(YourType)); |
|||
}); |
|||
``` |
|||
@ -0,0 +1,62 @@ |
|||
# LINGYUN.Abp.Auditing.Application.Contracts |
|||
|
|||
Application layer contracts module for audit logging, defining application service interfaces and data transfer objects. |
|||
|
|||
[简体中文](./README.md) |
|||
|
|||
## Features |
|||
|
|||
* Audit log application service interface definitions |
|||
* Audit log Data Transfer Objects (DTOs) definitions |
|||
* Audit log permission definitions |
|||
* Audit log query parameter definitions |
|||
|
|||
## Module Dependencies |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpAuditingApplicationContractsModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
## Permission Definitions |
|||
|
|||
* AuditLogging.AuditLogs - Audit log management |
|||
- AuditLogging.AuditLogs.Delete - Delete audit logs |
|||
- AuditLogging.SecurityLogs - Security log management |
|||
- AuditLogging.SecurityLogs.Delete - Delete security logs |
|||
|
|||
## Service Interfaces |
|||
|
|||
* IAuditLogAppService |
|||
```csharp |
|||
public interface IAuditLogAppService : IApplicationService |
|||
{ |
|||
Task<AuditLogDto> GetAsync(Guid id); |
|||
Task<PagedResultDto<AuditLogDto>> GetListAsync(GetAuditLogsInput input); |
|||
Task DeleteAsync(Guid id); |
|||
Task DeleteManyAsync(DeleteManyAuditLogsInput input); |
|||
} |
|||
``` |
|||
|
|||
* ISecurityLogAppService |
|||
```csharp |
|||
public interface ISecurityLogAppService : IApplicationService |
|||
{ |
|||
Task<SecurityLogDto> GetAsync(Guid id); |
|||
Task<PagedResultDto<SecurityLogDto>> GetListAsync(GetSecurityLogsInput input); |
|||
Task DeleteAsync(Guid id); |
|||
Task DeleteManyAsync(DeleteManySecurityLogsInput input); |
|||
} |
|||
``` |
|||
|
|||
## Data Transfer Objects |
|||
|
|||
* AuditLogDto - Audit log DTO |
|||
* SecurityLogDto - Security log DTO |
|||
* GetAuditLogsInput - Input parameters for getting audit logs |
|||
* GetSecurityLogsInput - Input parameters for getting security logs |
|||
* DeleteManyAuditLogsInput - Input parameters for batch deleting audit logs |
|||
* DeleteManySecurityLogsInput - Input parameters for batch deleting security logs |
|||
@ -0,0 +1,62 @@ |
|||
# LINGYUN.Abp.Auditing.Application.Contracts |
|||
|
|||
审计日志应用层契约模块,定义审计日志的应用服务接口和数据传输对象。 |
|||
|
|||
[English](./README.EN.md) |
|||
|
|||
## 功能特性 |
|||
|
|||
* 审计日志应用服务接口定义 |
|||
* 审计日志数据传输对象(DTO)定义 |
|||
* 审计日志权限定义 |
|||
* 审计日志查询参数定义 |
|||
|
|||
## 模块引用 |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpAuditingApplicationContractsModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
## 权限定义 |
|||
|
|||
* AuditLogging.AuditLogs - 审计日志管理 |
|||
- AuditLogging.AuditLogs.Delete - 删除审计日志 |
|||
- AuditLogging.SecurityLogs - 安全日志管理 |
|||
- AuditLogging.SecurityLogs.Delete - 删除安全日志 |
|||
|
|||
## 服务接口 |
|||
|
|||
* IAuditLogAppService |
|||
```csharp |
|||
public interface IAuditLogAppService : IApplicationService |
|||
{ |
|||
Task<AuditLogDto> GetAsync(Guid id); |
|||
Task<PagedResultDto<AuditLogDto>> GetListAsync(GetAuditLogsInput input); |
|||
Task DeleteAsync(Guid id); |
|||
Task DeleteManyAsync(DeleteManyAuditLogsInput input); |
|||
} |
|||
``` |
|||
|
|||
* ISecurityLogAppService |
|||
```csharp |
|||
public interface ISecurityLogAppService : IApplicationService |
|||
{ |
|||
Task<SecurityLogDto> GetAsync(Guid id); |
|||
Task<PagedResultDto<SecurityLogDto>> GetListAsync(GetSecurityLogsInput input); |
|||
Task DeleteAsync(Guid id); |
|||
Task DeleteManyAsync(DeleteManySecurityLogsInput input); |
|||
} |
|||
``` |
|||
|
|||
## 数据传输对象 |
|||
|
|||
* AuditLogDto - 审计日志DTO |
|||
* SecurityLogDto - 安全日志DTO |
|||
* GetAuditLogsInput - 获取审计日志输入参数 |
|||
* GetSecurityLogsInput - 获取安全日志输入参数 |
|||
* DeleteManyAuditLogsInput - 批量删除审计日志输入参数 |
|||
* DeleteManySecurityLogsInput - 批量删除安全日志输入参数 |
|||
@ -0,0 +1,66 @@ |
|||
# LINGYUN.Abp.Auditing.Application |
|||
|
|||
Application layer module for audit logging, providing implementation of audit logging application services. |
|||
|
|||
[简体中文](./README.md) |
|||
|
|||
## Features |
|||
|
|||
* Audit log query service |
|||
* Audit log management service |
|||
* Security log query service |
|||
* Integration with auto-mapping functionality |
|||
|
|||
## Module Dependencies |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpAuditingApplicationModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
## Required Modules |
|||
|
|||
* `LINGYUN.Abp.AuditLogging` - Audit logging core module |
|||
* `LINGYUN.Abp.Logging` - Logging infrastructure module |
|||
* `AbpAutoMapper` - ABP auto-mapping module |
|||
|
|||
## Service Interfaces |
|||
|
|||
* IAuditLogAppService - Audit log application service |
|||
- GetAsync - Get a specific audit log |
|||
- GetListAsync - Get a list of audit logs |
|||
- DeleteAsync - Delete a specific audit log |
|||
- DeleteManyAsync - Batch delete audit logs |
|||
|
|||
* ISecurityLogAppService - Security log application service |
|||
- GetAsync - Get a specific security log |
|||
- GetListAsync - Get a list of security logs |
|||
- DeleteAsync - Delete a specific security log |
|||
- DeleteManyAsync - Batch delete security logs |
|||
|
|||
## Basic Usage |
|||
|
|||
1. Reference the module |
|||
2. Inject the required application service |
|||
3. Call the appropriate service methods |
|||
|
|||
Example: |
|||
```csharp |
|||
public class YourService |
|||
{ |
|||
private readonly IAuditLogAppService _auditLogAppService; |
|||
|
|||
public YourService(IAuditLogAppService auditLogAppService) |
|||
{ |
|||
_auditLogAppService = auditLogAppService; |
|||
} |
|||
|
|||
public async Task<AuditLogDto> GetAuditLogAsync(Guid id) |
|||
{ |
|||
return await _auditLogAppService.GetAsync(id); |
|||
} |
|||
} |
|||
``` |
|||
@ -0,0 +1,66 @@ |
|||
# LINGYUN.Abp.Auditing.Application |
|||
|
|||
审计日志应用层模块,提供审计日志的应用服务实现。 |
|||
|
|||
[English](./README.EN.md) |
|||
|
|||
## 功能特性 |
|||
|
|||
* 审计日志查询服务 |
|||
* 审计日志管理服务 |
|||
* 安全日志查询服务 |
|||
* 集成自动映射功能 |
|||
|
|||
## 模块引用 |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpAuditingApplicationModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
## 依赖模块 |
|||
|
|||
* `LINGYUN.Abp.AuditLogging` - 审计日志核心模块 |
|||
* `LINGYUN.Abp.Logging` - 日志基础模块 |
|||
* `AbpAutoMapper` - ABP自动映射模块 |
|||
|
|||
## 服务接口 |
|||
|
|||
* IAuditLogAppService - 审计日志应用服务 |
|||
- GetAsync - 获取指定的审计日志 |
|||
- GetListAsync - 获取审计日志列表 |
|||
- DeleteAsync - 删除指定的审计日志 |
|||
- DeleteManyAsync - 批量删除审计日志 |
|||
|
|||
* ISecurityLogAppService - 安全日志应用服务 |
|||
- GetAsync - 获取指定的安全日志 |
|||
- GetListAsync - 获取安全日志列表 |
|||
- DeleteAsync - 删除指定的安全日志 |
|||
- DeleteManyAsync - 批量删除安全日志 |
|||
|
|||
## 基本用法 |
|||
|
|||
1. 引用模块 |
|||
2. 注入所需的应用服务 |
|||
3. 调用相应的服务方法 |
|||
|
|||
示例: |
|||
```csharp |
|||
public class YourService |
|||
{ |
|||
private readonly IAuditLogAppService _auditLogAppService; |
|||
|
|||
public YourService(IAuditLogAppService auditLogAppService) |
|||
{ |
|||
_auditLogAppService = auditLogAppService; |
|||
} |
|||
|
|||
public async Task<AuditLogDto> GetAuditLogAsync(Guid id) |
|||
{ |
|||
return await _auditLogAppService.GetAsync(id); |
|||
} |
|||
} |
|||
``` |
|||
@ -0,0 +1,50 @@ |
|||
# LINGYUN.Abp.Auditing.HttpApi |
|||
|
|||
HTTP API module for audit logging, providing REST API interfaces for audit logging functionality. |
|||
|
|||
[简体中文](./README.md) |
|||
|
|||
## Features |
|||
|
|||
* Audit log REST API interfaces |
|||
* Security log REST API interfaces |
|||
* Support for API versioning |
|||
* Integration with Swagger documentation |
|||
|
|||
## Module Dependencies |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpAuditingHttpApiModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
## API Endpoints |
|||
|
|||
### Audit Logs |
|||
|
|||
* GET /api/audit-logging/audit-logs/{id} - Get a specific audit log |
|||
* GET /api/audit-logging/audit-logs - Get a list of audit logs |
|||
* DELETE /api/audit-logging/audit-logs/{id} - Delete a specific audit log |
|||
* DELETE /api/audit-logging/audit-logs/batch - Batch delete audit logs |
|||
|
|||
### Security Logs |
|||
|
|||
* GET /api/audit-logging/security-logs/{id} - Get a specific security log |
|||
* GET /api/audit-logging/security-logs - Get a list of security logs |
|||
* DELETE /api/audit-logging/security-logs/{id} - Delete a specific security log |
|||
* DELETE /api/audit-logging/security-logs/batch - Batch delete security logs |
|||
|
|||
## Basic Usage |
|||
|
|||
1. Reference the module |
|||
2. Configure permissions (if needed) |
|||
3. Call the appropriate API endpoints using an HTTP client |
|||
|
|||
## API Documentation |
|||
|
|||
After starting the application, you can view the complete API documentation through: |
|||
* /swagger - Swagger UI interface |
|||
* /swagger/v1/swagger.json - OpenAPI specification document |
|||
@ -0,0 +1,50 @@ |
|||
# LINGYUN.Abp.Auditing.HttpApi |
|||
|
|||
审计日志HTTP API模块,提供审计日志的REST API接口。 |
|||
|
|||
[English](./README.EN.md) |
|||
|
|||
## 功能特性 |
|||
|
|||
* 审计日志REST API接口 |
|||
* 安全日志REST API接口 |
|||
* 支持API版本控制 |
|||
* 集成Swagger文档 |
|||
|
|||
## 模块引用 |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpAuditingHttpApiModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
|
|||
## API接口 |
|||
|
|||
### 审计日志 |
|||
|
|||
* GET /api/audit-logging/audit-logs/{id} - 获取指定的审计日志 |
|||
* GET /api/audit-logging/audit-logs - 获取审计日志列表 |
|||
* DELETE /api/audit-logging/audit-logs/{id} - 删除指定的审计日志 |
|||
* DELETE /api/audit-logging/audit-logs/batch - 批量删除审计日志 |
|||
|
|||
### 安全日志 |
|||
|
|||
* GET /api/audit-logging/security-logs/{id} - 获取指定的安全日志 |
|||
* GET /api/audit-logging/security-logs - 获取安全日志列表 |
|||
* DELETE /api/audit-logging/security-logs/{id} - 删除指定的安全日志 |
|||
* DELETE /api/audit-logging/security-logs/batch - 批量删除安全日志 |
|||
|
|||
## 基本用法 |
|||
|
|||
1. 引用模块 |
|||
2. 配置权限(如需要) |
|||
3. 通过HTTP客户端调用相应的API接口 |
|||
|
|||
## API文档 |
|||
|
|||
启动应用程序后,可以通过Swagger UI查看完整的API文档: |
|||
* /swagger - Swagger UI界面 |
|||
* /swagger/v1/swagger.json - OpenAPI规范文档 |
|||
Loading…
Reference in new issue