refactors data access layer to use pop ORM for eager loading, adds book titles rented to renters in response body

This commit is contained in:
David Lick
2020-05-31 00:40:32 -04:00
parent a06b4d70ab
commit 28e52a4e08
29 changed files with 732 additions and 287 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ import (
"time"
bookish "github.com/davidlick/bookish/bookish-server"
"github.com/davidlick/bookish/bookish-server/inventory"
"github.com/davidlick/bookish/bookish-server/rental"
"github.com/davidlick/bookish/bookish-server/renter"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
@@ -21,8 +21,8 @@ type Server struct {
Port string
BooksHost string
Logger *logrus.Logger
Renter renter.Service
Inventory inventory.Service
Renters renter.Service
Rentals rental.Service
// LibraryMap holds a map of values that are returned by the books API. This is used to check
// if a book exists in the library.
LibraryMap struct {