Files
Swarm/DysonNetwork.Drive/Billing/UsageController.cs
2025-07-26 23:21:57 +08:00

26 lines
644 B
C#

using Microsoft.AspNetCore.Mvc;
namespace DysonNetwork.Drive.Billing;
[ApiController]
[Route("api/billing/usage")]
public class UsageController(UsageService usageService) : ControllerBase
{
[HttpGet]
public async Task<ActionResult<TotalUsageDetails>> GetTotalUsage()
{
return await usageService.GetTotalUsage();
}
[HttpGet("{poolId:guid}")]
public async Task<ActionResult<UsageDetails>> GetPoolUsage(Guid poolId)
{
var usageDetails = await usageService.GetPoolUsage(poolId);
if (usageDetails == null)
{
return NotFound();
}
return usageDetails;
}
}