向宁 fc4ecbbacc feat: add gRPC auth, condition comparators, seed data, EF migrations
- gRPC auth service for token validation
- Value comparator system (string, numeric, boolean, datetime, collection)
- Condition evaluator with strategy chain
- Form definition and data improvements
- Workflow instance/task endpoints updated
- Seed data and EF design-time factory
- Test coverage for comparators and handlers
2026-05-20 20:28:35 +08:00

36 lines
933 B
C#

using FastEndpoints;
using MediatR;
using Workflow.Application.Features.WorkflowTasks.DTOs;
using Workflow.Application.Features.WorkflowTasks.Queries;
namespace Workflow.Api.Endpoints.WorkflowTask;
public class GetTaskByIdEndpoint : Endpoint<GetTaskByIdRequest, WorkflowTaskListItemDto>
{
private readonly IMediator _mediator;
public GetTaskByIdEndpoint(IMediator mediator) => _mediator = mediator;
public override void Configure()
{
Get("/workflow-tasks/{Id}");
AllowAnonymous();
Summary(s =>
{
s.Summary = "Get task detail by id";
});
}
public override async Task HandleAsync(GetTaskByIdRequest req, CancellationToken ct)
{
var query = new GetTaskByIdQuery(req.Id);
var result = await _mediator.Send(query, ct);
await Send.OkAsync(result, ct);
}
}
public class GetTaskByIdRequest
{
public Guid Id { get; set; }
}