✨ Usage drive
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DysonNetwork.Drive.Billing;
|
||||
|
||||
public class UsageController
|
||||
[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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user