Adds an `.editorconfig` file with C# and project-specific conventions. Applies consistent indentation and formatting across backend handlers, runtime models, and AI services.
30 lines
857 B
C#
30 lines
857 B
C#
using FastEndpoints;
|
|
|
|
namespace SpaceGame.Api.PlayerFaction.Api;
|
|
|
|
public sealed class DeletePlayerDirectiveRequest
|
|
{
|
|
public string DirectiveId { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class DeletePlayerDirectiveHandler(WorldService worldService) : Endpoint<DeletePlayerDirectiveRequest, PlayerFactionSnapshot>
|
|
{
|
|
public override void Configure()
|
|
{
|
|
Delete("/api/player-faction/directives/{directiveId}");
|
|
AllowAnonymous();
|
|
}
|
|
|
|
public override async Task HandleAsync(DeletePlayerDirectiveRequest request, CancellationToken cancellationToken)
|
|
{
|
|
var snapshot = worldService.DeletePlayerDirective(request.DirectiveId);
|
|
if (snapshot is null)
|
|
{
|
|
await SendNotFoundAsync(cancellationToken);
|
|
return;
|
|
}
|
|
|
|
await SendOkAsync(snapshot, cancellationToken);
|
|
}
|
|
}
|