feat: new handlers - WIP

This commit is contained in:
Elton Minetto
2020-06-26 15:51:51 -03:00
parent adc2331b89
commit bf36e4cc88
5 changed files with 126 additions and 63 deletions
+6 -1
View File
@@ -9,6 +9,8 @@ import (
"strconv"
"time"
"github.com/eminetto/clean-architecture-go-v2/domain/loan"
"github.com/eminetto/clean-architecture-go-v2/domain/entity/user"
"github.com/eminetto/clean-architecture-go-v2/domain/entity/book"
@@ -39,7 +41,7 @@ func main() {
userRepo := user.NewMySQLRepoRepository(db)
userService := user.NewService(userRepo)
//loanService := loan.NewService(userService, bookService)
loanService := loan.NewService(userService, bookService)
metricService, err := metric.NewPrometheusService()
if err != nil {
@@ -58,6 +60,9 @@ func main() {
//user
handler.MakeUserHandlers(r, *n, userService)
//loan
handler.MakeLoanHandlers(r, *n, bookService, userService, loanService)
http.Handle("/", r)
http.Handle("/metrics", promhttp.Handler())
r.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) {