43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using TileServer.Domain.Extracts;
|
|
|
|
namespace TileServer.Application.Extracts;
|
|
|
|
public sealed record ExtractResponse(
|
|
string Id,
|
|
string Name,
|
|
string Url,
|
|
bool Enabled,
|
|
double[] Center,
|
|
int MinZoom,
|
|
int MaxZoom,
|
|
string TileUrlTemplate,
|
|
string TileJsonUrl,
|
|
ExtractSyncState Status,
|
|
DateTimeOffset? DownloadedAt,
|
|
DateTimeOffset? BuiltAt,
|
|
long? PbfBytes,
|
|
string? LastError,
|
|
TilesetBounds? Bounds);
|
|
|
|
public sealed record TilesetBounds(double MinLon, double MinLat, double MaxLon, double MaxLat);
|
|
|
|
public sealed record CreateExtractRequest(
|
|
string Id,
|
|
string Name,
|
|
string Url,
|
|
double[]? Center,
|
|
int? MinZoom,
|
|
int? MaxZoom,
|
|
bool Enabled = true);
|
|
|
|
public interface IExtractService
|
|
{
|
|
Task<IReadOnlyList<ExtractResponse>> ListAsync(string baseUrl, CancellationToken ct);
|
|
|
|
Task<ExtractResponse> GetAsync(string id, string baseUrl, CancellationToken ct);
|
|
|
|
Task<ExtractResponse> AddOrUpdateAsync(CreateExtractRequest request, string baseUrl, CancellationToken ct);
|
|
|
|
Task RemoveAsync(string id, CancellationToken ct);
|
|
}
|