Adds an `.editorconfig` file with C# and project-specific conventions. Applies consistent indentation and formatting across backend handlers, runtime models, and AI services.
31 lines
865 B
C#
31 lines
865 B
C#
using FastEndpoints;
|
|
|
|
namespace SpaceGame.Api.Ships.Api;
|
|
|
|
public sealed class RemoveShipOrderRequest
|
|
{
|
|
public string ShipId { get; set; } = string.Empty;
|
|
public string OrderId { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class RemoveShipOrderHandler(WorldService worldService) : Endpoint<RemoveShipOrderRequest, ShipSnapshot>
|
|
{
|
|
public override void Configure()
|
|
{
|
|
Delete("/api/ships/{shipId}/orders/{orderId}");
|
|
AllowAnonymous();
|
|
}
|
|
|
|
public override async Task HandleAsync(RemoveShipOrderRequest request, CancellationToken cancellationToken)
|
|
{
|
|
var snapshot = worldService.RemoveShipOrder(request.ShipId, request.OrderId);
|
|
if (snapshot is null)
|
|
{
|
|
await SendNotFoundAsync(cancellationToken);
|
|
return;
|
|
}
|
|
|
|
await SendOkAsync(snapshot, cancellationToken);
|
|
}
|
|
}
|