- Added endpoints for managing form definitions including: - GetFormDefinitionById - GetFormDefinitionList - PublishFormDefinition - SubmitFormData - UpdateFormDefinition - Added endpoints for managing workflow definitions including: - CreateWorkflowDefinition - DeleteWorkflowDefinition - DisableWorkflowDefinition - GetWorkflowDefinitionById - GetWorkflowDefinitionList - PublishWorkflowDefinition - UpdateWorkflowDefinition - Added endpoints for managing workflow instances including: - GetWorkflowInstanceById - GetWorkflowInstanceList - MonitorWorkflowInstances - ResumeWorkflowInstance - StartWorkflowInstance - SuspendWorkflowInstance - WithdrawWorkflowInstance - Added endpoints for managing workflow tasks including: - ApproveTask - DelegateTask - GetCcTasks - GetHistoryTasks - GetOverdueTasks - GetPendingTasks - GetTaskById - RejectTask - TransferTask - UrgeTask - Introduced middleware for handling API responses and global exceptions. - Configured application settings for database connection and JWT authentication.
35 lines
956 B
C#
35 lines
956 B
C#
using FastEndpoints;
|
|
using MediatR;
|
|
using Workflow.Application.Features.WorkflowDefinitions.Commands;
|
|
|
|
namespace Workflow.Api.Endpoints.WorkflowDefinition;
|
|
|
|
public class PublishWorkflowDefinitionEndpoint : Endpoint<PublishWorkflowDefinitionRequest>
|
|
{
|
|
private readonly IMediator _mediator;
|
|
|
|
public PublishWorkflowDefinitionEndpoint(IMediator mediator) => _mediator = mediator;
|
|
|
|
public override void Configure()
|
|
{
|
|
Post("/workflow-definitions/{Id}/publish");
|
|
AllowAnonymous();
|
|
Summary(s =>
|
|
{
|
|
s.Summary = "Publish a workflow definition";
|
|
});
|
|
}
|
|
|
|
public override async Task HandleAsync(PublishWorkflowDefinitionRequest req, CancellationToken ct)
|
|
{
|
|
var command = new PublishWorkflowDefinitionCommand(req.Id);
|
|
await _mediator.Send(command, ct);
|
|
await SendOkAsync(ct);
|
|
}
|
|
}
|
|
|
|
public class PublishWorkflowDefinitionRequest
|
|
{
|
|
public Guid Id { get; set; }
|
|
}
|