User book API: use a single query with result and count
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user