Added Controller Endpoints for reserve, release and confirm

This commit is contained in:
Marco Kittel 2025-07-18 10:29:21 +02:00
parent ffd99d7938
commit e2697cee5b
1 changed files with 13 additions and 4 deletions

View File

@ -2,12 +2,11 @@ package main
import ( import (
"fmt" "fmt"
"gittea.marcokittel.de/elio/eliotools/datawriter/internal/api"
"gittea.marcokittel.de/elio/eliotools/datawriter/internal/database"
"log" "log"
"net/http" "net/http"
"os" "os"
"gittea.marcokittel.de/elio/eliotools/datawriter/internal/api"
"gittea.marcokittel.de/elio/eliotools/datawriter/internal/database"
) )
var ( var (
@ -27,7 +26,17 @@ func main() {
return return
} }
//Dependency Injection //Dependency Injection
http.HandleFunc("/api/products", api.GetProductApiHandleFunc(nps)) http.HandleFunc("/api/products$", api.GetProductApiHandleFunc(nps))
http.HandleFunc("/api/products/reserve", func(w http.ResponseWriter, r *http.Request) {
fmt.Println("In Arbeit: reserve")
})
http.HandleFunc("/api/products/confirm", func(w http.ResponseWriter, r *http.Request) {
fmt.Println("In Arbeit: confirm")
})
http.HandleFunc("/api/products/release", func(w http.ResponseWriter, r *http.Request) {
fmt.Println("In Arbeit: release")
})
log.Printf("Easy Peasy: Die Party startet auf Port %s\n", port) log.Printf("Easy Peasy: Die Party startet auf Port %s\n", port)
log.Printf("Probiers mal damit: %s\n", curlhelp) log.Printf("Probiers mal damit: %s\n", curlhelp)
log.Fatal(http.ListenAndServe(port, nil)) log.Fatal(http.ListenAndServe(port, nil))