docs
This commit is contained in:
28
docs/pages/api/talas_v5_DB/area/readArea.md
Normal file
28
docs/pages/api/talas_v5_DB/area/readArea.md
Normal file
@@ -0,0 +1,28 @@
|
||||
<!-- /docs/pages/api/talas_v5_DB/area/readArea.md -->
|
||||
|
||||
# 📥 readArea.js
|
||||
|
||||
Liest Bereichskoordinaten (`location_coordinates`) aus der Datenbank basierend auf `idMaps` (und optional `idLocation`).
|
||||
|
||||
## Methode
|
||||
|
||||
- `GET`
|
||||
|
||||
## URL-Parameter
|
||||
|
||||
| Name | Beschreibung |
|
||||
|-------------|--------------------------------------|
|
||||
| `m` | Karten-ID (entspricht `idMaps`) |
|
||||
| `idLocation` | (optional) ID eines bestimmten Bereichs |
|
||||
|
||||
## Verhalten
|
||||
|
||||
- Joint `location`, `location_coordinates` und `area`-Tabelle
|
||||
- Gibt strukturierte Daten mit `x`, `y`, `location_name`, `area_name` zurück
|
||||
- Nutzt MySQL-Pool (`getPool()`)
|
||||
|
||||
## Beispiel
|
||||
|
||||
```http
|
||||
GET /api/talas_v5_DB/area/readArea?m=3
|
||||
```
|
||||
32
docs/pages/api/talas_v5_DB/area/updateArea.md
Normal file
32
docs/pages/api/talas_v5_DB/area/updateArea.md
Normal file
@@ -0,0 +1,32 @@
|
||||
<!-- /docs/pages/api/talas_v5_DB/area/updateArea.md -->
|
||||
|
||||
# 📤 updateArea.js
|
||||
|
||||
Aktualisiert die Koordinaten eines Bereichs (`location_coordinates`) basierend auf `idLocation` und `idMap`.
|
||||
|
||||
## Methode
|
||||
|
||||
- `PUT`
|
||||
|
||||
## Request-Body
|
||||
|
||||
```json
|
||||
{
|
||||
"idLocation": 12,
|
||||
"idMap": 3,
|
||||
"x": 53.21421,
|
||||
"y": 8.43212
|
||||
}
|
||||
```
|
||||
|
||||
## Verhalten
|
||||
|
||||
- Führt `UPDATE location_coordinates SET x=?, y=? WHERE idLocation=? AND idMaps=?`
|
||||
- Gibt bei Erfolg `success: true` zurück
|
||||
- Nutzt MySQL-Pool und `connection.release()`
|
||||
|
||||
## Fehlerbehandlung
|
||||
|
||||
- 400: Fehlende Daten
|
||||
- 404: Kein Eintrag gefunden
|
||||
- 500: Interner Fehler
|
||||
Reference in New Issue
Block a user