Switch from open library API to Inventaire API

This commit is contained in:
2026-01-16 16:12:59 +01:00
parent 1bb841332c
commit a04aff6056
22 changed files with 338 additions and 108 deletions

View File

@@ -10,6 +10,7 @@ type BookGet struct {
Title string `json:"title" binding:"required,max=300"`
Author string `json:"author" binding:"max=100"`
ISBN string `json:"isbn"`
InventaireId string `json:"inventaireid"`
OpenLibraryId string `json:"openlibraryid"`
Summary string `json:"summary"`
Rating int `json:"rating"`
@@ -23,7 +24,7 @@ type BookGet struct {
func FetchBookGet(db *gorm.DB, userId uint, bookId uint64) (BookGet, error) {
var book BookGet
query := db.Model(&model.Book{})
selectQueryString := "books.title, authors.name as author, books.isbn, books.open_library_id, books.summary, " +
selectQueryString := "books.title, authors.name as author, books.isbn, books.inventaire_id, books.open_library_id, books.summary, " +
"user_books.rating, user_books.read, user_books.want_read, " +
"DATE(user_books.start_read_date) as start_read_date, " +
"DATE(user_books.end_read_date) AS end_read_date, " +