This commit is contained in:
Anton Martynenko
2025-11-19 18:27:35 +01:00
parent 48ebad0609
commit 9048a7b3ec
6 changed files with 56 additions and 54 deletions
@@ -30,13 +30,6 @@ public class RegionRepository : IRegionRepository
WHERE id = @Id";
var region = await connection.QuerySingleOrDefaultAsync<RegionEntity>(sql, new { Id = id });
if (region != null)
{
_logger.LogInformation("RegionRepository - Read region {RegionId} from DB: Lat={Lat:F12}, Lon={Lon:F12}, Status={Status}",
id, region.Latitude, region.Longitude, region.Status);
}
return region;
}
@@ -71,9 +64,6 @@ public class RegionRepository : IRegionRepository
@CreatedAt, @UpdatedAt)
RETURNING id";
_logger.LogInformation("RegionRepository - Inserting region {RegionId} to DB: Lat={Lat:F12}, Lon={Lon:F12}, Status={Status}",
region.Id, region.Latitude, region.Longitude, region.Status);
return await connection.ExecuteScalarAsync<Guid>(sql, region);
}
@@ -44,14 +44,6 @@ public class RouteRepository : IRouteRepository
ORDER BY sequence_number";
var points = (await connection.QueryAsync<RoutePointEntity>(sql, new { RouteId = routeId })).ToList();
if (points.Any())
{
_logger.LogInformation("RouteRepository - Read {Count} points from DB for route {RouteId}. First: Lat={Lat:F12}, Lon={Lon:F12}, Last: Lat={LastLat:F12}, Lon={LastLon:F12}",
points.Count, routeId, points[0].Latitude, points[0].Longitude,
points[^1].Latitude, points[^1].Longitude);
}
return points;
}
@@ -82,13 +74,6 @@ public class RouteRepository : IRouteRepository
@PointType, @SegmentIndex, @DistanceFromPrevious, @CreatedAt)";
var pointsList = points.ToList();
if (pointsList.Any())
{
_logger.LogInformation("RouteRepository - Inserting {Count} points to DB. First: Lat={Lat:F12}, Lon={Lon:F12}, Last: Lat={LastLat:F12}, Lon={LastLon:F12}",
pointsList.Count, pointsList[0].Latitude, pointsList[0].Longitude,
pointsList[^1].Latitude, pointsList[^1].Longitude);
}
await connection.ExecuteAsync(sql, pointsList);
}
@@ -28,13 +28,6 @@ public class TileRepository : ITileRepository
WHERE id = @Id";
var tile = await connection.QuerySingleOrDefaultAsync<TileEntity>(sql, new { Id = id });
if (tile != null)
{
_logger.LogInformation("TileRepository - Read tile {TileId} from DB: Lat={Lat:F12}, Lon={Lon:F12}, Zoom={Zoom}",
id, tile.Latitude, tile.Longitude, tile.ZoomLevel);
}
return tile;
}
@@ -116,9 +109,6 @@ public class TileRepository : ITileRepository
updated_at = EXCLUDED.updated_at
RETURNING id";
_logger.LogInformation("TileRepository - Inserting tile {TileId} to DB: Lat={Lat:F12}, Lon={Lon:F12}, Zoom={Zoom}",
tile.Id, tile.Latitude, tile.Longitude, tile.ZoomLevel);
return await connection.ExecuteScalarAsync<Guid>(sql, tile);
}