gateway/docs/real-estate-feature-integration-guide/11-testing.md

1.7 KiB

Testing

← Zurück: Sicherheitshinweise | Weiter: Troubleshooting →

Manuelle API-Tests mit curl:

# 1. Login (erhalten Sie Token)
curl -X POST "http://localhost:8000/api/local/auth/login" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "username=youruser&password=yourpass"

# 2. Session erstellen
curl -X POST "http://localhost:8000/api/realestate/sessions" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title": "Parzellen-Analyse Zürich"}'

# 3. Query ausführen - Beispiel: Alle Parzellen in Zürich
curl -X POST "http://localhost:8000/api/realestate/sessions/SESSION_ID/queries" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "queryText": "SELECT label, plz, bauzone, az, bz, gebaeudehoeheMax FROM Parzelle WHERE plz = ''8000'' ORDER BY label LIMIT 20",
    "queryType": "sql"
  }'

# 4. Query ausführen - Beispiel: Projekte mit Status "Planung"
curl -X POST "http://localhost:8000/api/realestate/sessions/SESSION_ID/queries" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "queryText": "SELECT id, label, \"statusProzess\" FROM Projekt WHERE \"statusProzess\" = ''Planung''",
    "queryType": "sql"
  }'

# 5. Queries abrufen
curl -X GET "http://localhost:8000/api/realestate/sessions/SESSION_ID/queries" \
  -H "Authorization: Bearer YOUR_TOKEN"

Swagger UI:

Nach dem Start der Anwendung können Sie die API unter http://localhost:8000/docs testen.


← Zurück: Sicherheitshinweise | Weiter: Troubleshooting →