Skip to content

Latest commit

 

History

History
131 lines (106 loc) · 1.33 KB

endpoints.md

File metadata and controls

131 lines (106 loc) · 1.33 KB

Endpoints

HTTP GET /overview

Returns:

{
    "res":[
        {
            "id": 1,
            "stav": 0
        },
        ...
    ]
}

HTTP POST /product

Data:

{
  "nazev": "Kofola 0,5L",
  "cena": 27.5,
  "popis": "Dobrý sladký nápoj",
  "kategorie": [1, 15, 45]
}

Returns:

{
  "res": {
    "id": 1,
    "nazev": "Kofola 0,5L",
    "cena": 27.5,
    "popis": "Dobrý sladký nápoj",
    "skryty": false
  }
}

HTTP POST /order

Data:

{
    "produkty": [
        {
            "id":1,
            "pocet":5
        },
        ...
    ]
}

Returns:

{
  "res": {
    "id": 1,
    "cena": 54.95,
    "stav": 0,
    "timestamp": ...
  }
}

HTTP GET /menu

Returns:

{
    "res":[
        {
            "nazev": "Kofola",
            "cena": 0,
            "popis": "Dobrý sladký nápoj",
            "skryty": false,
            "id": 1,
            "kategorie": [
                {
                    "id": 0,
                    "nazev": "sladké"
                }, ...
            ]

        }, ...
    ]
}

HTTP POST /category

Data

{
  "nazev": "Sladké"
}

Returns

{
  "res": {
    "id": 1,
    "nazev": "Sladké"
  }
}

HTTP POST /state

Data:

{
  "objednavka": 1,
  "stav": 2
}

Returns: nothing