spartacus-inventur-backend/api.go

24 lines
442 B
Go
Raw Normal View History

package main
import (
"fmt"
"net/http"
"github.com/gin-gonic/gin"
)
func postDrinks(c *gin.Context) {
if err := c.BindJSON(&postResult); err != nil {
return
}
c.IndentedJSON(http.StatusCreated, postResult)
fmt.Println("Name:", postResult.Name)
fmt.Println("Comment:", postResult.Comment)
fmt.Println("Timestamp:", postResult.Timestamp)
fmt.Println("Inventory:")
for _, d := range postResult.Inventory {
fmt.Println(d)
}
}