CHANGE: added get for create booking

This commit is contained in:
2024-09-19 16:26:35 +02:00
parent 0c0034644e
commit 8b2e042f62
2 changed files with 53 additions and 0 deletions

View File

@@ -33,6 +33,8 @@ func timeCreateHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "PUT":
createBooking(w, r)
case "GET":
createBooking(w, r)
case "OPTIONS":
w.WriteHeader(http.StatusOK)
default:

View File

@@ -155,6 +155,57 @@
"description": "Same booking type as last booking"
}
}
},
"get": {
"tags": ["booking"],
"summary": "Create new Booking",
"description": "Creates a new booking with the supplied parameters",
"operationId": "createBooking",
"parameters": [
{
"name": "card_uid",
"in": "query",
"description": "id of the RFID card scanned",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "geraet_id",
"in": "query",
"description": "id of the RFID reader scanning the card",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "check_in_out",
"in": "query",
"description": "booking Type",
"required": true,
"schema": {
"type": "integer",
"enum": [1, 2, 255]
}
}
],
"responses": {
"200": {
"description": "successfully created booking",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Booking"
}
}
}
},
"409": {
"description": "Same booking type as last booking"
}
}
}
}
},