73 lines
2.1 KiB
Go
73 lines
2.1 KiB
Go
package dto
|
|
|
|
type AuthorGet struct {
|
|
Name string `json:"name" binding:"required,max=100"`
|
|
Description string `json:"description"`
|
|
}
|
|
|
|
type InventaireSearchType int
|
|
|
|
const (
|
|
NoInventaireSearch InventaireSearchType = iota
|
|
InventaireIfNothingFound
|
|
ForceInventaireSearch
|
|
)
|
|
|
|
type BookSearchGetParam struct {
|
|
Lang string `form:"lang" binding:"max=5"`
|
|
Inventaire InventaireSearchType `form:"inventaire"`
|
|
}
|
|
|
|
type BookFields struct {
|
|
Title *string `json:"title" binding:"omitempty,max=300"`
|
|
Author *string `json:"author" binding:"omitempty,max=100"`
|
|
ISBN *string `json:"isbn" binding:"omitempty,max=18"`
|
|
InventaireID *string `json:"inventaireid" binding:"omitempty,max=50"`
|
|
OpenLibraryId *string `json:"openlibraryid" binding:"omitempty,max=50"`
|
|
ShortDescription *string `json:"shortdescription" binding:"omitempty,max=300"`
|
|
Summary *string `json:"summary"`
|
|
CoverID *uint `json:"coverId"`
|
|
}
|
|
|
|
type BookPostImport struct {
|
|
InventaireID string `json:"inventaireid" binding:"required,max=50"`
|
|
Lang string `json:"lang" binding:"required,max=5"`
|
|
}
|
|
|
|
type UserBookPutUpdate struct {
|
|
Read *bool `json:"read"`
|
|
EndDate *string `json:"endDate"`
|
|
WantRead *bool `json:"wantread"`
|
|
Rating *int `json:"rating"`
|
|
StartDate *string `json:"startDate"`
|
|
Review *string `json:"review"`
|
|
}
|
|
|
|
type CollectionFields struct {
|
|
Name string `json:"name" binding:"required,max=300"`
|
|
}
|
|
|
|
type CollectionBook struct {
|
|
BookID uint `json:"bookId" binding:"required"`
|
|
}
|
|
|
|
type CollectionItemPosition struct {
|
|
Position uint `json:"position" binding:"required,gte=1"`
|
|
ItemID uint `json:"itemId" binding:"required"`
|
|
}
|
|
|
|
type FileInfoPost struct {
|
|
FileID uint `json:"fileId"`
|
|
FilePath string `json:"filepath"`
|
|
}
|
|
|
|
type UserLogin struct {
|
|
Username string `json:"username" binding:"required,min=2,max=20"`
|
|
Password string `json:"password" binding:"required,min=6,max=100"`
|
|
}
|
|
|
|
type UserSignup struct {
|
|
Username string `json:"username" binding:"required,min=2,max=20"`
|
|
Password string `json:"password" binding:"required,min=6,max=100"`
|
|
}
|