Search API: use a single query with result and count

This commit is contained in:
2026-01-23 14:45:25 +01:00
parent 8689082741
commit 601e583575
9 changed files with 94 additions and 144 deletions

5
internal/dto/in.go Normal file
View File

@@ -0,0 +1,5 @@
package dto
type BookSearchGetParam struct {
Lang string `form:"lang" binding:"max=5"`
}

18
internal/dto/out.go Normal file
View File

@@ -0,0 +1,18 @@
package dto
type BookSearchGet struct {
Count int64 `json:"count"`
Books []BookSearchGetBook `json:"books"`
}
type BookSearchGetBook struct {
ID uint `json:"id"`
Title string `json:"title" binding:"required,max=300"`
Author string `json:"author" binding:"max=100"`
Description string `json:"description"`
InventaireID string `json:"inventaireid"`
Rating int `json:"rating"`
Read bool `json:"read"`
WantRead bool `json:"wantread"`
CoverPath string `json:"coverPath"`
}