docs+refactor: fetchGisStationsStatusDistrict Port-Logik vereinheitlicht
- zentrale Steuerung über .env.local (`NEXT_PUBLIC_API_PORT_MODE`) - URL-Parameter m/u werden in idMap/idUser übersetzt - Webservice-Aufruf korrekt über /GisStationsStatusDistrict aufgebaut - Doku ergänzt: /docs/frontend/redux/api/fromWebService/fetchGisStationsStatusDistrict.md - CHANGELOG.md auf v1.1.73 aktualisiert
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
# 🌐 fetchGisStationsStatusDistrict – Gerätestatus nach Bezirken abrufen
|
||||
|
||||
## Zweck
|
||||
|
||||
Diese Funktion ruft die aktuellen Statusdaten aller Geräte eines bestimmten Kartenbezirks ab.
|
||||
Sie basiert auf dem Webservice-Endpunkt `GisStationsStatusDistrict`.
|
||||
|
||||
---
|
||||
|
||||
## Webservice-Endpunkt
|
||||
|
||||
```
|
||||
GisStationsStatusDistrict?idMap={idMap}&idUser={idUser}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Portsteuerung über Umgebungsvariable
|
||||
|
||||
Da die Webservices in allen Umgebungen über Port 80 laufen,
|
||||
wird der Zugriff über eine Umgebungsvariable in `.env.local` konfiguriert:
|
||||
|
||||
```env
|
||||
NEXT_PUBLIC_API_PORT_MODE=dev
|
||||
```
|
||||
|
||||
### Codebeispiel:
|
||||
|
||||
```js
|
||||
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
|
||||
|
||||
const apiBaseUrl =
|
||||
mode === "dev"
|
||||
? `${window.location.protocol}//${window.location.hostname}:80/talas5/ClientData/WebServiceMap.asmx`
|
||||
: `${window.location.origin}/talas5/ClientData/WebServiceMap.asmx`;
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## URL-Parameter
|
||||
|
||||
| Parameter | Beschreibung | Übergabe durch TALAS.web |
|
||||
|-----------|--------------|---------------------------|
|
||||
| `m` | Map-ID | Ja |
|
||||
| `u` | User-ID | Ja |
|
||||
|
||||
```js
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const idMap = params.get("m");
|
||||
const idUser = params.get("u");
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Beispiel
|
||||
|
||||
```
|
||||
http://10.10.0.13/talas5/MessagesMap/mapTypeC.aspx?m=12&u=484
|
||||
```
|
||||
|
||||
→ wird übersetzt zu:
|
||||
|
||||
```
|
||||
http://10.10.0.13/talas5/ClientData/WebServiceMap.asmx/GisStationsStatusDistrict?idMap=12&idUser=484
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Siehe auch
|
||||
|
||||
- `.env.local` → `NEXT_PUBLIC_API_PORT_MODE`
|
||||
- `fetchGisStationsStaticDistrict.js`
|
||||
- `fetchGisStationsMeasurements.js`
|
||||
- `fetchGisSystemStatic.js`
|
||||
|
||||
---
|
||||
|
||||
📄 Pfad: `/docs/frontend/redux/api/fromWebService/fetchGisStationsStatusDistrict.md`
|
||||
Reference in New Issue
Block a user