25 lines
636 B
25 lines
636 B
using Kean.Domain.Task.Commands;
|
|
|
|
namespace Kean.Domain.Task.SharedServices
|
|
{
|
|
/// <summary>
|
|
/// 任务执行
|
|
/// </summary>
|
|
public sealed class Execute
|
|
{
|
|
private readonly ICommandBus _commandBus;
|
|
|
|
/// <summary>
|
|
/// 依赖注入
|
|
/// </summary>
|
|
public Execute(ICommandBus commandBus) =>
|
|
_commandBus = commandBus;
|
|
|
|
/// <summary>
|
|
/// 处理程序
|
|
/// </summary>
|
|
/// <param name="id">标识</param>
|
|
public System.Threading.Tasks.Task Handler(int id) =>
|
|
_commandBus.Execute(new ExecuteCommand { Id = id });
|
|
}
|
|
}
|