Browse Source

feat(docs): 添加任务管理模块文档

pull/1049/head
feijie 1 year ago
parent
commit
66d5be130d
  1. 21
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/README.EN.md
  2. 21
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/README.EN.md
  3. 17
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/README.EN.md
  4. 26
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/README.EN.md
  5. 40
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/README.EN.md
  6. 42
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Hangfire/README.EN.md
  7. 64
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/README.EN.md
  8. 54
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/README.EN.md
  9. 54
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/README.EN.md
  10. 150
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/README.EN.md
  11. 72
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/README.EN.md
  12. 72
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/README.md
  13. 88
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/README.EN.md
  14. 88
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/README.md
  15. 68
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/README.EN.md
  16. 68
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/README.md
  17. 75
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/README.EN.md
  18. 75
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/README.md
  19. 64
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/README.EN.md
  20. 64
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/README.md
  21. 45
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/README.EN.md
  22. 45
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/README.md
  23. 80
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/README.EN.md
  24. 80
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/README.md

21
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/README.EN.md

@ -0,0 +1,21 @@
# LINGYUN.Abp.BackgroundTasks.Abstractions
Background task (queue) module abstraction layer, defining basic constructs and interfaces.
## Feature Parameters
* DisableJobActionAttribute: Mark this feature to disable job trigger behavior processing
* DisableJobStatusAttribute: Mark this feature to disable job status processing
* DisableAuditingAttribute: Mark this feature to disable job logging
## Configuration and Usage
Module reference:
```csharp
[DependsOn(typeof(AbpBackgroundTasksAbstractionsModule))]
public class YouProjectModule : AbpModule
{
// other
}
```

21
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/README.EN.md

@ -0,0 +1,21 @@
# LINGYUN.Abp.BackgroundTasks.Activities
Background task (queue) module behavior processing module.
## Interface Parameters
* IJobActionStore: Implement this interface to get job management behaviors
* JobActionDefinitionProvider: Implement this interface to customize job behaviors
* JobExecutedProvider: Implement this interface to extend job behaviors
## Configuration and Usage
Module reference:
```csharp
[DependsOn(typeof(AbpBackgroundTasksActivitiesModule))]
public class YouProjectModule : AbpModule
{
// other
}
```

17
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/README.EN.md

@ -0,0 +1,17 @@
# LINGYUN.Abp.BackgroundTasks.DistributedLocking
Background task (queue) module distributed locking module.
See: [Distributed-Locking](https://docs.abp.io/en/abp/latest/Distributed-Locking)
## Configuration and Usage
Module reference:
```csharp
[DependsOn(typeof(AbpBackgroundTasksDistributedLockingModule))]
public class YouProjectModule : AbpModule
{
// other
}
```

26
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/README.EN.md

@ -0,0 +1,26 @@
# LINGYUN.Abp.BackgroundTasks.EventBus
Background task (queue) module distributed event module, integrating this module enables applications to handle job events.
## Configuration and Usage
Module reference:
```csharp
[DependsOn(typeof(AbpBackgroundTasksEventBusModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
## Features
The module provides various job event types:
- JobEventData - Base event data for all job events
- JobStartEventData - Event data when a job starts
- JobStopEventData - Event data when a job stops
- JobPauseEventData - Event data when a job is paused
- JobResumeEventData - Event data when a job resumes
- JobTriggerEventData - Event data when a job is triggered

40
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/README.EN.md

@ -0,0 +1,40 @@
# LINGYUN.Abp.BackgroundTasks.ExceptionHandling
Background job execution exception notification implementation, using Email to send notifications by default.
## Configuration and Usage
Module reference:
```csharp
[DependsOn(typeof(AbpBackgroundTasksExceptionHandlingModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
## Action Parameters
** Specify the following parameters in the job definition to send notifications when the job execution fails:
* to Required, recipient email address
* from Optional, sender name in email header
* body Optional, email content (required if template name is not specified)
* subject Optional, email subject
* template Optional, email template
* context Optional, context parameters when using template
* culture Optional, template culture when using template
## Features
- Supports email-based exception notifications for background jobs
- Customizable email templates with localization support
- Rich context information in notifications including:
- Tenant name (if applicable)
- Job group
- Job name
- Job ID
- Job type
- Trigger time
- Error message

42
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Hangfire/README.EN.md

@ -0,0 +1,42 @@
# LINGYUN.Abp.BackgroundTasks.Hangfire
Background task module implementation based on Hangfire.
## Configuration and Usage
Module reference:
```csharp
[DependsOn(typeof(AbpBackgroundTasksHangfireModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
## Features
- Integrates with Hangfire for background job processing
- Supports job execution events and monitoring
- Implements distributed locking for job execution
- Provides job execution context and result handling
- Includes job parameter management
- Supports job cancellation and timeout handling
## Components
- `HangfireJobExecutedAttribute`: Handles job execution events and locking
- `HangfireJobSimpleAdapter`: Adapts job execution to the Hangfire infrastructure
- Job event handling with support for:
- Before execution events
- After execution events
- Execution result handling
- Error handling and logging
## Job Execution Flow
1. Job scheduling through Hangfire
2. Pre-execution locking (if configured)
3. Job execution with context
4. Event handling and result processing
5. Lock release and cleanup

64
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/README.EN.md

@ -0,0 +1,64 @@
# LINGYUN.Abp.BackgroundTasks.Jobs
Common job module for background tasks (queue).
## Job List
* [ConsoleJob](./LINGYUN/Abp/BackgroundTasks/Jobs/ConsoleJob): Console output
* [HttpRequestJob](./LINGYUN/Abp/BackgroundTasks/Jobs/HttpRequestJob): HTTP request
* [SendEmailJob](./LINGYUN/Abp/BackgroundTasks/Jobs/SendEmailJob): Send email
* [SendSmsJob](./LINGYUN/Abp/BackgroundTasks/Jobs/SendSmsJob): Send SMS
* [ServiceInvocationJob](./LINGYUN/Abp/BackgroundTasks/Jobs/ServiceInvocationJob): Service invocation (HTTP request extension)
* [SleepJob](./LINGYUN/Abp/BackgroundTasks/Jobs/SleepJob): Sleep, delay job execution
## Configuration and Usage
Module reference:
```csharp
[DependsOn(typeof(AbpBackgroundTasksJobsModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
## Features
### Console Job
- Output messages to console with timestamp
- Configurable message content
### HTTP Request Job
- Support for various HTTP methods (GET, PUT, POST, PATCH, OPTIONS, DELETE)
- Custom headers and content type
- Request data handling
- Culture support
### Email Job
- Send emails with customizable:
- Recipients
- Subject
- From address
- Body content
- Email templates
- Template model and context
- Culture support
### SMS Job
- Send SMS messages with:
- Phone number targeting
- Message content
- Custom properties
### Service Invocation Job
- Extended HTTP request functionality
- Support for different providers (http, dapr)
- Multi-tenant support
- Service name configuration
- Dapr integration with App ID support
### Sleep Job
- Delay job execution
- Configurable delay duration in milliseconds
- Default 20-second delay if not specified

54
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/README.EN.md

@ -0,0 +1,54 @@
# LINGYUN.Abp.BackgroundTasks.Notifications
Background job execution notification events.
## Configuration and Usage
Module reference:
```csharp
[DependsOn(typeof(AbpBackgroundTasksNotificationsModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
## Action Parameters
** Notification content formatting parameters, which will send real-time notifications after job execution:
* push-provider Optional, specify message push provider
* use-template Optional, template name for formatting notification content
* content Optional, notification content (required if template name is not specified)
* culture Optional, template culture when using template
## Features
### Notification Types
- Job Success Notification
- Job Failure Notification
- Job Completion Notification
### Supported Push Providers
- SignalR (real-time notification)
- SMS (SMS notification)
- Emailing (email notification)
- WeChat.MiniProgram (WeChat Mini Program)
- WxPusher (WxPusher WeChat push service)
- PushPlus (PushPlus multi-platform push service)
### Notification Features
- Multi-tenant support
- Localization support
- Template-based content formatting
- Multiple push provider support
- Severity-based notifications (Info, Success, Warning, Error)
- Rich notification content with job details:
- Job ID
- Job Group
- Job Name
- Job Type
- Trigger Time
- Tenant Name (if applicable)
- Error Message (for failed jobs)

54
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/README.EN.md

@ -0,0 +1,54 @@
# LINGYUN.Abp.BackgroundTasks.Quartz
Background task module implementation based on Quartz, with added listener functionality to notify administrators of task status.
## Configuration and Usage
Module reference (refer to Volo.Abp.Quartz module for detailed configuration):
```csharp
[DependsOn(typeof(AbpBackgroundTasksQuartzModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
## Features
### Job Scheduling
- Support for various job types:
- One-time jobs
- Periodic jobs (with Cron expressions)
- Persistent jobs
- Job priority management
- Start/end time scheduling
- Interval-based execution
### Job Management
- Job queuing and execution
- Job pausing and resuming
- Job triggering on demand
- Job removal and cleanup
### Job Execution
- Concurrent job execution support
- Job execution context management
- Job parameter passing
- Job result handling
### Job Monitoring
- Job execution event listening
- Job status tracking
- Error handling and logging
- Multi-tenant support
### Distributed Features
- Distributed job locking
- Node-specific job execution
- Lock timeout management
### Adapters
- `QuartzJobSimpleAdapter`: For simple job execution
- `QuartzJobConcurrentAdapter`: For concurrent job execution
- `QuartzJobSearchJobAdapter`: For runtime job discovery

150
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/README.EN.md

@ -0,0 +1,150 @@
# LINGYUN.Abp.BackgroundTasks
Background task (queue) module that extends ABP's background jobs and workers with Cron expression support, providing manageable background task (queue) functionality.
Implements **Volo.Abp.BackgroundJobs.IBackgroundJobManager**, meaning you can add new jobs through the framework's background job interface.
Implements **Volo.Abp.BackgroundWorkers.IBackgroundWorkerManager**, meaning you can add new jobs through the framework's background worker interface.
## Task Types
* JobType.Once: One-time task, executed only once, suitable for scenarios like email notifications
* JobType.Period: Periodic task, runs according to a Cron expression, suitable for scenarios like report analysis
* JobType.Persistent: Persistent task, runs according to given repeat count and interval, suitable for scenarios like API stress testing
## Interface Description
* [IJobPublisher](/LINGYUN/Abp/BackgroundTasks/IJobPublisher.cs): Job publishing interface, publishes specified jobs to the current node
* [IJobDispatcher](/LINGYUN/Abp/BackgroundTasks/IJobDispatcher.cs): Job dispatching interface, dispatches specified jobs to specified nodes
* [IJobScheduler](/LINGYUN/Abp/BackgroundTasks/IJobScheduler.cs): Scheduler interface, manages job scheduler for the current running node
* [IJobLockProvider](/LINGYUN/Abp/BackgroundTasks/IJobLockProvider.cs): Job locking interface, locks specified jobs to prevent duplicate execution, lock duration is specified by **LockTimeOut**
* [IJobEventTrigger](/LINGYUN/Abp/BackgroundTasks/IJobEventTrigger.cs): Job event trigger interface, listens to events before and after job execution
* [IJobStore](/LINGYUN/Abp/BackgroundTasks/IJobStore.cs): Job persistence interface
## Configuration and Usage
Module reference:
```csharp
[DependsOn(typeof(AbpBackgroundTasksModule))]
public class YouProjectModule : AbpModule
{
// other
}
```
Example usage:
```csharp
public class DemoClass
{
protected IServiceProvider ServiceProvider { get; }
public DemoClass(IServiceProvider serviceProvider)
{
ServiceProvider = serviceProvider;
}
public async Task Some()
{
var scheduler = ServiceProvider.GetRequiredService<IJobScheduler>();
// Add a periodic task (every 5 seconds) to the queue
await scheduler.QueueAsync(new JobInfo
{
Type = typeof(ConsoleJob).AssemblyQualifiedName,
Args = new Dictionary<string, object>(),
Name = "Test-Console-Period",
Group = "Test",
Description = "Test-Console",
Id = Guid.NewGuid(),
JobType = JobType.Period,
Priority = Volo.Abp.BackgroundJobs.BackgroundJobPriority.Low,
Cron = "0/5 * * * * ? ",
TryCount = 10,
Status = JobStatus.Running,
// Define this field to handle concurrency
LockTimeOut = 120,
});
// Add a one-time task to the queue, to be executed after 10 seconds (Interval)
await scheduler.QueueAsync(new JobInfo
{
Type = typeof(ConsoleJob).AssemblyQualifiedName,
Args = new Dictionary<string, object>(),
Name = "Test-Console-Once",
Group = "Test",
Description = "Test-Console",
Id = Guid.NewGuid(),
JobType = JobType.Once,
Priority = Volo.Abp.BackgroundJobs.BackgroundJobPriority.Low,
Interval = 10,
TryCount = 10,
Status = JobStatus.Running,
});
// Add a persistent task to the queue, to be executed after 10 seconds (Interval), maximum 5 executions (MaxCount)
await scheduler.QueueAsync(new JobInfo
{
Type = typeof(ConsoleJob).AssemblyQualifiedName,
Args = new Dictionary<string, object>(),
Name = "Test-Console-Persistent",
Group = "Test",
Description = "Test-Console",
Id = Guid.NewGuid(),
JobType = JobType.Persistent,
Priority = Volo.Abp.BackgroundJobs.BackgroundJobPriority.Low,
Interval = 10,
TryCount = 10,
MaxCount = 5,
Status = JobStatus.Running,
});
// You can also add framework background jobs to the job scheduler without changing usage habits
var backgroundJobManager = ServiceProvider.GetRequiredService<IBackgroundJobManager>();
await jobManager.EnqueueAsync(
new SmsJobArgs
{
PhoneNumber = "13800138000",
Message = "Message from framework background worker"
},
BackgroundJobPriority.High,
TimeSpan.FromSeconds(10));
// Similarly, you can add framework background workers to the job scheduler without changing usage habits
var backgroundWorkManager = ServiceProvider.GetRequiredService<IBackgroundWorkerManager>();
// Console output every 20 seconds
await backgroundWorkManager.AddAsync(ServiceProvider.GetRequiredService<ConsoleWorker>());
}
}
public class SmsJobArgs
{
public string PhoneNumber { get; set; }
public string Message { get; set; }
}
public class SmsJob : AsyncBackgroundJob<SmsJobArgs>, ITransientDependency
{
public override Task ExecuteAsync(SmsJobArgs args)
{
Console.WriteLine($"Send sms message: {args.Message}");
return Task.CompletedTask;
}
}
public class ConsoleWorker : AsyncPeriodicBackgroundWorkerBase, ISingletonDependency
{
public ConsoleWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory)
: base(timer, serviceScopeFactory)
{
timer.Period = 20000;
}
protected override Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext)
{
Console.WriteLine($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] - ConsoleWorker Do Work.");
return Task.CompletedTask;
}
}
```

72
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/README.EN.md

@ -0,0 +1,72 @@
# LINGYUN.Abp.TaskManagement.Application.Contracts
Application contracts for task management module, defining interfaces and DTOs for application services.
## Features
### Application Service Interfaces
- Background Job Info Service:
- CRUD operations
- Job control operations
- Batch operations
- Query operations
- Background Job Action Service:
- Action management
- Action definitions
- Parameter handling
- Background Job Log Service:
- Log retrieval
- Log filtering
- Log deletion
### Data Transfer Objects (DTOs)
- Background Job Info DTOs:
- Job info DTO
- Job creation DTO
- Job update DTO
- Job list DTO
- Job batch input DTO
- Background Job Action DTOs:
- Action DTO
- Action creation DTO
- Action update DTO
- Action definition DTO
- Action parameter DTO
- Background Job Log DTOs:
- Log DTO
- Log list DTO
- Log filter DTO
### Permissions
- Background Jobs:
- Create permission
- Update permission
- Delete permission
- Trigger permission
- Pause permission
- Resume permission
- Start permission
- Stop permission
- Background Job Logs:
- View permission
- Delete permission
### Remote Service Configuration
- Service name constants
- Service endpoint configuration
- Client proxy settings
### Validation
- Input validation
- Data annotations
- Custom validation rules
### Integration Features
- ABP Framework integration
- Dynamic query support
- Application service layer abstraction
### Module Configuration
- Module dependencies
- Service registration
- Feature management

72
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/README.md

@ -0,0 +1,72 @@
# LINGYUN.Abp.TaskManagement.Application.Contracts
任务管理模块的应用程序契约,定义应用服务的接口和DTO。
## 功能
### 应用服务接口
- 后台作业信息服务:
- CRUD操作
- 作业控制操作
- 批量操作
- 查询操作
- 后台作业行为服务:
- 行为管理
- 行为定义
- 参数处理
- 后台作业日志服务:
- 日志检索
- 日志过滤
- 日志删除
### 数据传输对象(DTOs)
- 后台作业信息DTOs:
- 作业信息DTO
- 作业创建DTO
- 作业更新DTO
- 作业列表DTO
- 作业批量输入DTO
- 后台作业行为DTOs:
- 行为DTO
- 行为创建DTO
- 行为更新DTO
- 行为定义DTO
- 行为参数DTO
- 后台作业日志DTOs:
- 日志DTO
- 日志列表DTO
- 日志过滤DTO
### 权限
- 后台作业:
- 创建权限
- 更新权限
- 删除权限
- 触发权限
- 暂停权限
- 恢复权限
- 启动权限
- 停止权限
- 后台作业日志:
- 查看权限
- 删除权限
### 远程服务配置
- 服务名称常量
- 服务端点配置
- 客户端代理设置
### 验证
- 输入验证
- 数据注解
- 自定义验证规则
### 集成功能
- ABP框架集成
- 动态查询支持
- 应用服务层抽象
### 模块配置
- 模块依赖
- 服务注册
- 功能管理

88
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/README.EN.md

@ -0,0 +1,88 @@
# LINGYUN.Abp.TaskManagement.Application
The application layer implementation of the task management module, providing core functionality for background job management.
## Features
### Background Job Management Service
- Background Job Info Service (BackgroundJobInfoAppService)
- Implements CRUD operations for jobs
- Provides job control functions (start, stop, pause, resume, etc.)
- Supports batch operations
- Implements job querying and filtering
### Background Job Action Service (BackgroundJobActionAppService)
- Action Management Features:
- Add job actions
- Update job actions
- Delete job actions
- Get list of job actions
- Action Definition Management:
- Get available action definitions
- Action parameter configuration
- Action enable/disable control
### Background Job Log Service (BackgroundJobLogAppService)
- Log Management Features:
- Get log details
- Get log list
- Delete log records
- Log Query Features:
- Support for multiple condition queries
- Pagination
- Sorting functionality
- Advanced filtering
### Object Mapping Configuration
- AutoMapper Profile:
- Mapping from BackgroundJobInfo to BackgroundJobInfoDto
- Mapping from BackgroundJobLog to BackgroundJobLogDto
- Mapping from BackgroundJobAction to BackgroundJobActionDto
### Module Configuration
- Dependencies:
- AbpAutoMapper
- AbpDynamicQueryable
- TaskManagementDomain
- TaskManagementApplication.Contracts
- Service Configuration:
- Automatic object mapping configuration
- Validation configuration
### Extended Features
- Expression Extensions:
- AndIf conditional expression
- OrIf conditional expression
- Dynamic query support
- Localization resource integration
## Usage
1. Add module dependency:
```csharp
[DependsOn(typeof(TaskManagementApplicationModule))]
public class YourModule : AbpModule
{
// ...
}
```
2. Inject and use services:
```csharp
public class YourService
{
private readonly IBackgroundJobInfoAppService _jobInfoAppService;
private readonly IBackgroundJobActionAppService _jobActionAppService;
private readonly IBackgroundJobLogAppService _jobLogAppService;
public YourService(
IBackgroundJobInfoAppService jobInfoAppService,
IBackgroundJobActionAppService jobActionAppService,
IBackgroundJobLogAppService jobLogAppService)
{
_jobInfoAppService = jobInfoAppService;
_jobActionAppService = jobActionAppService;
_jobLogAppService = jobLogAppService;
}
}
```

88
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/README.md

@ -0,0 +1,88 @@
# LINGYUN.Abp.TaskManagement.Application
任务管理模块的应用层实现,提供后台作业管理的核心功能实现。
## 功能实现
### 后台作业管理服务
- 后台作业信息服务 (BackgroundJobInfoAppService)
- 实现作业的CRUD操作
- 提供作业控制功能(启动、停止、暂停、恢复等)
- 支持批量操作功能
- 实现作业查询和过滤
### 后台作业行为服务 (BackgroundJobActionAppService)
- 行为管理功能:
- 添加作业行为
- 更新作业行为
- 删除作业行为
- 获取作业行为列表
- 行为定义管理:
- 获取可用的行为定义
- 行为参数配置
- 行为启用/禁用控制
### 后台作业日志服务 (BackgroundJobLogAppService)
- 日志管理功能:
- 获取日志详情
- 获取日志列表
- 删除日志记录
- 日志查询功能:
- 支持多条件组合查询
- 分页查询
- 排序功能
- 高级过滤
### 对象映射配置
- AutoMapper配置文件:
- BackgroundJobInfo到BackgroundJobInfoDto的映射
- BackgroundJobLog到BackgroundJobLogDto的映射
- BackgroundJobAction到BackgroundJobActionDto的映射
### 模块配置
- 依赖模块:
- AbpAutoMapper
- AbpDynamicQueryable
- TaskManagementDomain
- TaskManagementApplication.Contracts
- 服务配置:
- 自动对象映射配置
- 验证配置
### 扩展功能
- 表达式扩展:
- AndIf条件表达式
- OrIf条件表达式
- 动态查询支持
- 本地化资源集成
## 使用方式
1. 添加模块依赖:
```csharp
[DependsOn(typeof(TaskManagementApplicationModule))]
public class YourModule : AbpModule
{
// ...
}
```
2. 注入并使用服务:
```csharp
public class YourService
{
private readonly IBackgroundJobInfoAppService _jobInfoAppService;
private readonly IBackgroundJobActionAppService _jobActionAppService;
private readonly IBackgroundJobLogAppService _jobLogAppService;
public YourService(
IBackgroundJobInfoAppService jobInfoAppService,
IBackgroundJobActionAppService jobActionAppService,
IBackgroundJobLogAppService jobLogAppService)
{
_jobInfoAppService = jobInfoAppService;
_jobActionAppService = jobActionAppService;
_jobLogAppService = jobLogAppService;
}
}
```

68
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/README.EN.md

@ -0,0 +1,68 @@
# LINGYUN.Abp.TaskManagement.Domain.Shared
Domain shared module for task management, containing shared domain models, enums, and constants.
## Features
### Permission Management
- Task Management permissions
- Background job permissions
- Job action permissions
- Job log permissions
### Job Types and Status
- Job Types:
- One-off jobs (executed once)
- Periodic jobs (executed periodically)
- Persistent jobs (executed repeatedly)
- Job Status:
- None
- Completed
- Running
- Queuing
- Paused
- Failed Retry
- Stopped
### Priority Levels
- Low
- Below Normal
- Normal
- Above Normal
- High
### Job Properties
- Basic Information:
- Group
- Name
- Description
- Type
- Status
- Begin/End Time
- Execution Settings:
- Interval (in seconds)
- Cron expression
- Lock timeout
- Priority
- Maximum trigger count
- Maximum retry count
- Tracking Information:
- Creation time
- Last run time
- Next run time
- Trigger count
- Try count
- Execution result
### Localization
- Support for multiple languages
- Error code localization
- UI text localization
### Multi-tenancy Support
- Tenant-specific job management
- System-level job management
### Source Types
- User jobs
- System jobs

68
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/README.md

@ -0,0 +1,68 @@
# LINGYUN.Abp.TaskManagement.Domain.Shared
任务管理领域共享模块,包含共享的领域模型、枚举和常量。
## 功能
### 权限管理
- 任务调度平台权限
- 后台作业权限
- 作业行为权限
- 作业日志权限
### 作业类型和状态
- 作业类型:
- 一次性作业(只执行一次)
- 周期性作业(按照给定条件周期性运行)
- 持续性作业(按照给定条件重复运行)
- 作业状态:
- 未定义
- 已完成
- 运行中
- 队列中
- 已暂停
- 失败重试
- 已停止
### 优先级别
- 低
- 低于正常
- 正常
- 高于正常
- 高
### 作业属性
- 基本信息:
- 分组
- 名称
- 描述
- 类型
- 状态
- 开始/结束时间
- 执行设置:
- 时间间隔(秒)
- Cron表达式
- 锁定超时时间
- 优先级
- 最大触发次数
- 最大重试次数
- 跟踪信息:
- 创建时间
- 上次执行时间
- 下次预期时间
- 触发次数
- 尝试次数
- 执行结果
### 本地化
- 支持多语言
- 错误代码本地化
- UI文本本地化
### 多租户支持
- 租户级作业管理
- 系统级作业管理
### 来源类型
- 用户作业
- 系统内置作业

75
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/README.EN.md

@ -0,0 +1,75 @@
# LINGYUN.Abp.TaskManagement.Domain
Domain module for task management, implementing core business logic and domain models.
## Features
### Background Job Management
- Job lifecycle management (create, update, delete)
- Job status control (start, stop, pause, resume, trigger)
- Support for different job types:
- One-off jobs
- Periodic jobs (with cron expressions)
- Persistent jobs (with intervals)
### Job Store
- Store job information and execution status
- Track job execution history
- Clean up expired jobs
- Support for multi-tenancy
### Job Synchronization
- Synchronize job status across distributed systems
- Handle job creation, update, and deletion events
- Maintain job queue consistency
### Job Actions
- Manage job-related actions
- Store action parameters
- Enable/disable actions
### Job Filtering and Specifications
- Filter jobs by multiple criteria:
- Type
- Group
- Name
- Status
- Priority
- Source
- Creation time
- Last run time
- Support for complex job queries
### Job Logging
- Log job execution details
- Track execution results and exceptions
- Support for multi-tenancy in logging
### Domain Events
- Job status change events
- Job execution events
- Distributed event handling
### Job Priority Management
- Support multiple priority levels:
- Low
- Below Normal
- Normal
- Above Normal
- High
### Job Source Management
- Support different job sources:
- User jobs
- System jobs
### Multi-tenancy Support
- Tenant-specific job management
- Cross-tenant job operations
- Tenant isolation in job execution
### Domain Services
- Background job manager
- Job store service
- Job action service
- Job log service

75
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/README.md

@ -0,0 +1,75 @@
# LINGYUN.Abp.TaskManagement.Domain
任务管理领域模块,实现核心业务逻辑和领域模型。
## 功能
### 后台作业管理
- 作业生命周期管理(创建、更新、删除)
- 作业状态控制(启动、停止、暂停、恢复、触发)
- 支持不同类型的作业:
- 一次性作业
- 周期性作业(使用cron表达式)
- 持续性作业(使用时间间隔)
### 作业存储
- 存储作业信息和执行状态
- 跟踪作业执行历史
- 清理过期作业
- 支持多租户
### 作业同步
- 在分布式系统中同步作业状态
- 处理作业创建、更新和删除事件
- 维护作业队列一致性
### 作业行为
- 管理作业相关行为
- 存储行为参数
- 启用/禁用行为
### 作业过滤和规范
- 通过多个条件过滤作业:
- 类型
- 分组
- 名称
- 状态
- 优先级
- 来源
- 创建时间
- 上次运行时间
- 支持复杂作业查询
### 作业日志
- 记录作业执行详情
- 跟踪执行结果和异常
- 支持多租户日志记录
### 领域事件
- 作业状态变更事件
- 作业执行事件
- 分布式事件处理
### 作业优先级管理
- 支持多个优先级别:
- 低
- 低于正常
- 正常
- 高于正常
- 高
### 作业来源管理
- 支持不同的作业来源:
- 用户作业
- 系统作业
### 多租户支持
- 租户特定的作业管理
- 跨租户作业操作
- 作业执行中的租户隔离
### 领域服务
- 后台作业管理器
- 作业存储服务
- 作业行为服务
- 作业日志服务

64
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/README.EN.md

@ -0,0 +1,64 @@
# LINGYUN.Abp.TaskManagement.EntityFrameworkCore
Entity Framework Core implementation for task management module, providing database access and persistence.
## Features
### Database Context
- TaskManagementDbContext for managing database operations
- Configurable table prefix and schema
- Support for multi-tenancy
### Entity Configurations
- Background Job Info:
- Table name: {prefix}BackgroundJobs
- Indexes on Name and Group
- Properties with length constraints
- Extra properties support
- Background Job Log:
- Table name: {prefix}BackgroundJobLogs
- Indexes on JobGroup and JobName
- Properties with length constraints
- Background Job Action:
- Table name: {prefix}BackgroundJobActions
- Index on Name
- Extra properties support for parameters
### Repository Implementations
- Background Job Info Repository:
- CRUD operations
- Job status management
- Job filtering and querying
- Support for job expiration
- Waiting job list management
- Period task management
- Background Job Log Repository:
- Log storage and retrieval
- Log filtering and querying
- Pagination support
- Background Job Action Repository:
- Action storage and retrieval
- Parameter management
### Query Features
- Dynamic sorting
- Pagination
- Filtering by specifications
- Asynchronous operations
- No-tracking queries for read-only operations
### Performance Optimizations
- Efficient indexing
- Batch operations support
- Optimized queries for job status
### Multi-tenancy Support
- Tenant-specific data isolation
- Cross-tenant operations
- Tenant-aware repositories
### Integration Features
- ABP Framework integration
- Entity Framework Core conventions
- Value converters for complex types
- Extra properties support

64
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/README.md

@ -0,0 +1,64 @@
# LINGYUN.Abp.TaskManagement.EntityFrameworkCore
任务管理模块的Entity Framework Core实现,提供数据库访问和持久化。
## 功能
### 数据库上下文
- TaskManagementDbContext用于管理数据库操作
- 可配置的表前缀和架构
- 支持多租户
### 实体配置
- 后台作业信息:
- 表名:{prefix}BackgroundJobs
- 对Name和Group建立索引
- 带长度约束的属性
- 支持额外属性
- 后台作业日志:
- 表名:{prefix}BackgroundJobLogs
- 对JobGroup和JobName建立索引
- 带长度约束的属性
- 后台作业行为:
- 表名:{prefix}BackgroundJobActions
- 对Name建立索引
- 支持参数的额外属性
### 仓储实现
- 后台作业信息仓储:
- CRUD操作
- 作业状态管理
- 作业过滤和查询
- 支持作业过期
- 等待作业列表管理
- 周期性任务管理
- 后台作业日志仓储:
- 日志存储和检索
- 日志过滤和查询
- 分页支持
- 后台作业行为仓储:
- 行为存储和检索
- 参数管理
### 查询功能
- 动态排序
- 分页
- 按规范过滤
- 异步操作
- 只读操作的无跟踪查询
### 性能优化
- 高效索引
- 支持批量操作
- 针对作业状态的优化查询
### 多租户支持
- 租户特定的数据隔离
- 跨租户操作
- 租户感知的仓储
### 集成功能
- ABP框架集成
- Entity Framework Core约定
- 复杂类型的值转换器
- 额外属性支持

45
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/README.EN.md

@ -0,0 +1,45 @@
# LINGYUN.Abp.TaskManagement.HttpApi.Client
HTTP API client implementation for task management module, providing client-side proxy services for remote API calls.
## Features
### HTTP Client Proxies
- Automatic proxy generation for application contracts
- Type-safe client interfaces
- Strongly-typed DTOs
### Remote Service Configuration
- Remote service name configuration
- Service endpoint configuration
- Client options configuration
### Authentication
- Token-based authentication support
- Authentication header handling
- Secure communication
### Service Integration
- Seamless integration with ABP Framework
- Dynamic HTTP client configuration
- Automatic service registration
### Error Handling
- Exception translation
- Error response handling
- Retry policies
### Client Features
- Asynchronous operations
- Request/response interceptors
- Automatic content negotiation
### Dependency Injection
- Automatic dependency registration
- Scoped service lifetime
- Service resolution
### Module Configuration
- Module dependency management
- Service configuration
- Client proxy configuration

45
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/README.md

@ -0,0 +1,45 @@
# LINGYUN.Abp.TaskManagement.HttpApi.Client
任务管理模块的HTTP API客户端实现,提供远程API调用的客户端代理服务。
## 功能
### HTTP客户端代理
- 自动生成应用程序契约的代理
- 类型安全的客户端接口
- 强类型DTO
### 远程服务配置
- 远程服务名称配置
- 服务端点配置
- 客户端选项配置
### 身份认证
- 基于令牌的身份认证支持
- 认证头处理
- 安全通信
### 服务集成
- 与ABP框架的无缝集成
- 动态HTTP客户端配置
- 自动服务注册
### 错误处理
- 异常转换
- 错误响应处理
- 重试策略
### 客户端功能
- 异步操作
- 请求/响应拦截器
- 自动内容协商
### 依赖注入
- 自动依赖注册
- 作用域服务生命周期
- 服务解析
### 模块配置
- 模块依赖管理
- 服务配置
- 客户端代理配置

80
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/README.EN.md

@ -0,0 +1,80 @@
# LINGYUN.Abp.TaskManagement.HttpApi
HTTP API implementation for task management module, providing RESTful endpoints for managing background jobs.
## Features
### Background Job Info API
- CRUD operations:
- Create new jobs
- Get job details
- Update job properties
- Delete jobs
- Job control operations:
- Start jobs
- Stop jobs
- Pause jobs
- Resume jobs
- Trigger jobs
- Batch operations:
- Bulk start
- Bulk stop
- Bulk pause
- Bulk resume
- Bulk trigger
- Bulk delete
- Query operations:
- Get job list with pagination
- Get job definitions
- Filter and sort jobs
### Background Job Action API
- Action management:
- Add actions to jobs
- Update action properties
- Delete actions
- Get action list
- Action definitions:
- Get available action definitions
- Query action definitions
### Background Job Log API
- Log operations:
- Get log details
- Get log list with pagination
- Delete logs
- Log filtering:
- Filter by job
- Filter by time range
- Filter by status
### Authorization
- Permission-based access control:
- Create job permission
- Update job permission
- Delete job permission
- Trigger job permission
- Pause job permission
- Resume job permission
- Start job permission
- Stop job permission
- Delete log permission
### API Features
- RESTful endpoints
- HTTP method-based operations
- Route-based API versioning
- Standardized response formats
- Pagination support
- Dynamic filtering and sorting
### Localization
- Multi-language support
- Localized error messages
- Localized validation messages
### Integration
- ABP Framework integration
- MVC integration
- Dynamic query support
- Validation support

80
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/README.md

@ -0,0 +1,80 @@
# LINGYUN.Abp.TaskManagement.HttpApi
任务管理模块的HTTP API实现,提供用于管理后台作业的RESTful接口。
## 功能
### 后台作业信息API
- CRUD操作:
- 创建新作业
- 获取作业详情
- 更新作业属性
- 删除作业
- 作业控制操作:
- 启动作业
- 停止作业
- 暂停作业
- 恢复作业
- 触发作业
- 批量操作:
- 批量启动
- 批量停止
- 批量暂停
- 批量恢复
- 批量触发
- 批量删除
- 查询操作:
- 获取分页作业列表
- 获取作业定义
- 过滤和排序作业
### 后台作业行为API
- 行为管理:
- 添加作业行为
- 更新行为属性
- 删除行为
- 获取行为列表
- 行为定义:
- 获取可用行为定义
- 查询行为定义
### 后台作业日志API
- 日志操作:
- 获取日志详情
- 获取分页日志列表
- 删除日志
- 日志过滤:
- 按作业过滤
- 按时间范围过滤
- 按状态过滤
### 授权
- 基于权限的访问控制:
- 创建作业权限
- 更新作业权限
- 删除作业权限
- 触发作业权限
- 暂停作业权限
- 恢复作业权限
- 启动作业权限
- 停止作业权限
- 删除日志权限
### API特性
- RESTful接口
- 基于HTTP方法的操作
- 基于路由的API版本控制
- 标准化的响应格式
- 分页支持
- 动态过滤和排序
### 本地化
- 多语言支持
- 本地化错误消息
- 本地化验证消息
### 集成
- ABP框架集成
- MVC集成
- 动态查询支持
- 验证支持
Loading…
Cancel
Save