using Oqtane.Models; using System.Threading.Tasks; using System.Net.Http; using System; using Oqtane.Documentation; using Oqtane.Shared; using System.Globalization; namespace Oqtane.Services { /// /// Service to retrieve information. /// public interface ISyncService { /// /// Get sync events /// /// /// Task GetSyncEventsAsync(DateTime lastSyncDate); } /// [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SyncService : ServiceBase, ISyncService { public SyncService(HttpClient http, SiteState siteState) : base(http, siteState) { } private string ApiUrl => CreateApiUrl("Sync"); /// public async Task GetSyncEventsAsync(DateTime lastSyncDate) { return await GetJsonAsync($"{ApiUrl}/{lastSyncDate.ToString("yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)}"); } } }