User book API: use a single query with result and count

This commit is contained in:
2026-01-25 00:42:50 +01:00
parent cd2b8a93bb
commit 8584e95ef7
15 changed files with 63 additions and 161 deletions

View File

@@ -16,6 +16,11 @@ type BookGet struct {
}
type BookUserGet struct {
Count int64 `json:"count"`
Books []BookUserGetBook `json:"books"`
}
type BookUserGetBook struct {
ID uint `json:"id"`
Title string `json:"title" binding:"required,max=300"`
Author string `json:"author" binding:"max=100"`