feat: add data sources config system and Earth API integration

- Add data_sources.yaml for configurable data source URLs
- Add data_sources.py to load config with database override support
- Add arcgis_landing_points and arcgis_cable_landing_relation collectors
- Change visualization API to query arcgis_landing_points
- Add /api/v1/datasources/configs/all endpoint
- Update Earth to fetch from API instead of static files
- Fix scheduler collector ID mappings
This commit is contained in:
rayd1o
2026-03-13 10:54:02 +08:00
parent 99771a88c5
commit de32552159
25 changed files with 222 additions and 23 deletions

View File

@@ -9,7 +9,8 @@ from datetime import datetime
import httpx
from app.services.collectors.base import BaseCollector
from app.core.config import settings
from app.core.data_sources import get_data_sources_config
class ArcGISCableCollector(BaseCollector):
@@ -21,7 +22,12 @@ class ArcGISCableCollector(BaseCollector):
@property
def base_url(self) -> str:
return settings.ARCGIS_CABLE_URL
if self._resolved_url:
return self._resolved_url
from app.core.data_sources import get_data_sources_config
config = get_data_sources_config()
return config.get_yaml_url("arcgis_cables")
async def fetch(self) -> List[Dict[str, Any]]:
params = {"where": "1=1", "outFields": "*", "returnGeometry": "true", "f": "geojson"}