adapt on booking new struct + instance of a resource

This commit is contained in:
mr
2025-02-05 08:41:16 +01:00
parent ea69be8df1
commit 43579a479f
9 changed files with 314 additions and 4 deletions

View File

@@ -163,6 +163,7 @@ func (o *BookingController) Check() {
// @Success 200 {object} models.object
// @router / [post]
func (o *BookingController) Post() {
fmt.Println("POST")
/*
* This function is used to create a booking.
* It takes the following parameters:
@@ -173,7 +174,7 @@ func (o *BookingController) Post() {
*/
var resp booking.Booking
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
json.Unmarshal(o.Ctx.Input.CopyBody(100000), &resp)
json.Unmarshal(o.Ctx.Input.CopyBody(10000000), &resp)
dc_id := resp.ResourceID
// delete all previous bookings
isDraft := o.Ctx.Input.Query("is_draft")