Wetter-Chip auf Karte + Bugfix private Routen zählen für km-Stats
- GET /api/weather?lat=&lon= (Open-Meteo, 30-min TTL-Cache) - Zecken-Warnung regelbasiert: März–Okt + Temp > 7°C - Karte: Wetterchip oben rechts nach GPS-Fix - stats.py + achievements.py: is_public-Filter entfernt — private Routen zählen jetzt für eigene km/Achievements - SW by-v320, APP_VER 308
This commit is contained in:
parent
43d33c0fd1
commit
0461f936ce
9 changed files with 185 additions and 13 deletions
20
backend/routes/weather.py
Normal file
20
backend/routes/weather.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
"""
|
||||
BAN YARO — Wetter-API
|
||||
GET /api/weather?lat=&lon= → aktuelles Wetter + Zecken-Warnung für Nutzerstandort
|
||||
"""
|
||||
|
||||
from fastapi import APIRouter, Query, HTTPException
|
||||
import weather as weather_module
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get('')
|
||||
async def get_weather(
|
||||
lat: float = Query(..., ge=-90, le=90),
|
||||
lon: float = Query(..., ge=-180, le=180),
|
||||
):
|
||||
try:
|
||||
return await weather_module.get_weather_for_location(lat, lon)
|
||||
except Exception as exc:
|
||||
raise HTTPException(503, f'Wetter nicht verfügbar: {exc}')
|
||||
Loading…
Add table
Add a link
Reference in a new issue