mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 09:06:38 +00:00
route stitching
This commit is contained in:
@@ -19,7 +19,10 @@ public class RouteRepository : IRouteRepository
|
||||
const string sql = @"
|
||||
SELECT id, name, description, region_size_meters as RegionSizeMeters,
|
||||
zoom_level as ZoomLevel, total_distance_meters as TotalDistanceMeters,
|
||||
total_points as TotalPoints, created_at as CreatedAt, updated_at as UpdatedAt
|
||||
total_points as TotalPoints, request_maps as RequestMaps,
|
||||
maps_ready as MapsReady, csv_file_path as CsvFilePath,
|
||||
summary_file_path as SummaryFilePath, stitched_image_path as StitchedImagePath,
|
||||
created_at as CreatedAt, updated_at as UpdatedAt
|
||||
FROM routes
|
||||
WHERE id = @Id";
|
||||
|
||||
@@ -45,9 +48,13 @@ public class RouteRepository : IRouteRepository
|
||||
using var connection = new NpgsqlConnection(_connectionString);
|
||||
const string sql = @"
|
||||
INSERT INTO routes (id, name, description, region_size_meters, zoom_level,
|
||||
total_distance_meters, total_points, created_at, updated_at)
|
||||
total_distance_meters, total_points, request_maps, maps_ready,
|
||||
csv_file_path, summary_file_path, stitched_image_path,
|
||||
created_at, updated_at)
|
||||
VALUES (@Id, @Name, @Description, @RegionSizeMeters, @ZoomLevel,
|
||||
@TotalDistanceMeters, @TotalPoints, @CreatedAt, @UpdatedAt)
|
||||
@TotalDistanceMeters, @TotalPoints, @RequestMaps, @MapsReady,
|
||||
@CsvFilePath, @SummaryFilePath, @StitchedImagePath,
|
||||
@CreatedAt, @UpdatedAt)
|
||||
RETURNING id";
|
||||
|
||||
return await connection.ExecuteScalarAsync<Guid>(sql, route);
|
||||
@@ -76,6 +83,11 @@ public class RouteRepository : IRouteRepository
|
||||
zoom_level = @ZoomLevel,
|
||||
total_distance_meters = @TotalDistanceMeters,
|
||||
total_points = @TotalPoints,
|
||||
request_maps = @RequestMaps,
|
||||
maps_ready = @MapsReady,
|
||||
csv_file_path = @CsvFilePath,
|
||||
summary_file_path = @SummaryFilePath,
|
||||
stitched_image_path = @StitchedImagePath,
|
||||
updated_at = @UpdatedAt
|
||||
WHERE id = @Id";
|
||||
|
||||
@@ -110,5 +122,21 @@ public class RouteRepository : IRouteRepository
|
||||
|
||||
return await connection.QueryAsync<Guid>(sql, new { RouteId = routeId });
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RouteEntity>> GetRoutesWithPendingMapsAsync()
|
||||
{
|
||||
using var connection = new NpgsqlConnection(_connectionString);
|
||||
const string sql = @"
|
||||
SELECT id, name, description, region_size_meters as RegionSizeMeters,
|
||||
zoom_level as ZoomLevel, total_distance_meters as TotalDistanceMeters,
|
||||
total_points as TotalPoints, request_maps as RequestMaps,
|
||||
maps_ready as MapsReady, csv_file_path as CsvFilePath,
|
||||
summary_file_path as SummaryFilePath, stitched_image_path as StitchedImagePath,
|
||||
created_at as CreatedAt, updated_at as UpdatedAt
|
||||
FROM routes
|
||||
WHERE request_maps = true AND maps_ready = false";
|
||||
|
||||
return await connection.QueryAsync<RouteEntity>(sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user