🎨 dokumentacia api
This commit is contained in:
23
API.md
Normal file
23
API.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
[domov](README.md)
|
||||||
|
# API dokumentacia
|
||||||
|
|
||||||
|
## Timer API
|
||||||
|
|
||||||
|
### Write Time Endpoint
|
||||||
|
|
||||||
|
**Endpoint:** `GET /api/timer/write/<str:timer_id>/<str:chip_id>/<str:time>/`
|
||||||
|
|
||||||
|
**Description:** Tento endpoint sluzi na zapis casu do databazy. Zaeoven vytvori
|
||||||
|
novy zaznam v tabulke `Lap` ak najde registraciu s danou kartou. Ak nieje ziadene ukopncene
|
||||||
|
kolo, tak vytovri nove a cas pouzije ako start. Ak najde neukoncene kolo, tak ho ukonci a
|
||||||
|
zapisuje cas ako end.
|
||||||
|
|
||||||
|
**Parameters:**
|
||||||
|
- `timer_id` (string): identifikator casomiery, ktora odosiela request. (napr. 12345)
|
||||||
|
- `chip_id` (string): id karty, ktora bola nacitana. (napr. 222-222-222-222)
|
||||||
|
- `time` (string): cas v timestamp formate spolu s milisekundami. (napr. 1741169316.149847)
|
||||||
|
|
||||||
|
**Example Request:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X GET "http://your-domain/api/timer/write/12345/222-222-222-222/1741169316.149847/"
|
||||||
@@ -3,6 +3,9 @@
|
|||||||
## Description
|
## Description
|
||||||
django app na secko
|
django app na secko
|
||||||
|
|
||||||
|
## Timer API
|
||||||
|
Otvorene api rozhranie s metodami pre citacky kariet. Viac info tu [Timer API](API.md)
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
potrebujes `.env` file alebo exportnut vsetky potrebne virtual environments.
|
potrebujes `.env` file alebo exportnut vsetky potrebne virtual environments.
|
||||||
Tie pouzije docker compose pri startovani kontainerov
|
Tie pouzije docker compose pri startovani kontainerov
|
||||||
|
|||||||
@@ -26,5 +26,5 @@ urlpatterns = [
|
|||||||
path("", include("users.urls")),
|
path("", include("users.urls")),
|
||||||
path("", include("core.urls")),
|
path("", include("core.urls")),
|
||||||
path("events/", include("events.urls")),
|
path("events/", include("events.urls")),
|
||||||
path("timer/", include("timer.urls")),
|
path("api/timer/", include("timer.urls")),
|
||||||
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|||||||
Reference in New Issue
Block a user