17 lines
425 B
C#
17 lines
425 B
C#
using FastEndpoints;
|
|
using SpaceGame.Api.Universe.Simulation;
|
|
|
|
namespace SpaceGame.Api.Universe.Api;
|
|
|
|
public sealed class GetBalanceHandler(WorldService worldService) : EndpointWithoutRequest
|
|
{
|
|
public override void Configure()
|
|
{
|
|
Get("/api/balance");
|
|
AllowAnonymous();
|
|
}
|
|
|
|
public override Task HandleAsync(CancellationToken cancellationToken) =>
|
|
SendOkAsync(worldService.GetBalance(), cancellationToken);
|
|
}
|