Use the same widget for books everywhere

This commit is contained in:
2026-03-27 22:08:24 +01:00
parent 726c640657
commit e05c9f2b45
17 changed files with 70 additions and 146 deletions

View File

@@ -6,7 +6,7 @@ type AppInfo struct {
DemoUsername string `json:"demoUsername"`
}
type BookGet struct {
type FullBookGet struct {
Title string `json:"title" binding:"required,max=300"`
Author string `json:"author" binding:"max=100"`
AuthorID uint `json:"authorId"`
@@ -23,28 +23,13 @@ type BookGet struct {
CoverPath string `json:"coverPath"`
}
type BookUserGet struct {
Count int64 `json:"count"`
Books []BookUserGetBook `json:"books"`
type BookItemsGet struct {
Count int64 `json:"count"`
Inventaire bool `json:"inventaire"`
Books []BookItemGet `json:"books"`
}
type BookUserGetBook struct {
ID uint `json:"id"`
Title string `json:"title" binding:"required,max=300"`
Author string `json:"author" binding:"max=100"`
Rating int `json:"rating" binding:"min=0,max=10"`
Read bool `json:"read" binding:"boolean"`
WantRead bool `json:"wantread" binding:"boolean"`
CoverPath string `json:"coverPath"`
}
type BookSearchGet struct {
Count int64 `json:"count"`
Inventaire bool `json:"inventaire"`
Books []BookSearchGetBook `json:"books"`
}
type BookSearchGetBook struct {
type BookItemGet struct {
ID uint `json:"id"`
Title string `json:"title" binding:"required,max=300"`
Author string `json:"author" binding:"max=100"`