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