CHANGE: added get for create booking
This commit is contained in:
@@ -33,6 +33,8 @@ func timeCreateHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
switch r.Method {
|
switch r.Method {
|
||||||
case "PUT":
|
case "PUT":
|
||||||
createBooking(w, r)
|
createBooking(w, r)
|
||||||
|
case "GET":
|
||||||
|
createBooking(w, r)
|
||||||
case "OPTIONS":
|
case "OPTIONS":
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -155,6 +155,57 @@
|
|||||||
"description": "Same booking type as last booking"
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user