Search API: use a single query with result and count
This commit is contained in:
5
internal/dto/in.go
Normal file
5
internal/dto/in.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package dto
|
||||
|
||||
type BookSearchGetParam struct {
|
||||
Lang string `form:"lang" binding:"max=5"`
|
||||
}
|
||||
18
internal/dto/out.go
Normal file
18
internal/dto/out.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user