Greenfield: App endpoints for sales statistics (#6103)

This commit is contained in:
d11n
2024-09-12 09:17:16 +02:00
committed by GitHub
parent 36bada8feb
commit 666445e8f7
13 changed files with 394 additions and 59 deletions

View File

@@ -14,6 +14,7 @@ using BTCPayServer.Controllers.GreenField;
using BTCPayServer.Data;
using BTCPayServer.Security;
using BTCPayServer.Security.Greenfield;
using BTCPayServer.Services.Apps;
using BTCPayServer.Services.Mails;
using BTCPayServer.Services.Stores;
using Microsoft.AspNetCore.Authorization;
@@ -1142,6 +1143,18 @@ namespace BTCPayServer.Controllers.Greenfield
await GetController<GreenfieldAppsController>().GetAllApps());
}
public override async Task<AppSalesStats> GetAppSales(string appId, int numberOfDays = 7, CancellationToken token = default)
{
return GetFromActionResult<AppSalesStats>(
await GetController<GreenfieldAppsController>().GetAppSales(appId, numberOfDays));
}
public override async Task<List<AppItemStats>> GetAppTopItems(string appId, int offset = 0, int count = 10, CancellationToken token = default)
{
return GetFromActionResult<List<AppItemStats>>(
await GetController<GreenfieldAppsController>().GetAppTopItems(appId, offset, count));
}
public override async Task DeleteApp(string appId, CancellationToken token = default)
{
HandleActionResult(await GetController<GreenfieldAppsController>().DeleteApp(appId));