Added Controller Endpoints for reserve, release and confirm
This commit is contained in:
parent
ffd99d7938
commit
e2697cee5b
|
|
@ -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))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue