using System.Net.Http; using System.Threading.Tasks; using System.Collections.Generic; using Oqtane.Documentation; using Oqtane.Shared; using Oqtane.Models; namespace Oqtane.Services { [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class ApiService : ServiceBase, IApiService { public ApiService(HttpClient http, SiteState siteState) : base(http, siteState) { } private string Apiurl => CreateApiUrl("Api"); public async Task> GetApisAsync(int siteId) { return await GetJsonAsync>($"{Apiurl}?siteid={siteId}"); } public async Task GetApiAsync(int siteId, string entityName) { return await GetJsonAsync($"{Apiurl}/{siteId}/{entityName}"); } public async Task UpdateApiAsync(Api api) { await PostJsonAsync(Apiurl, api); } } }