Move json struct in a new module
This commit is contained in:
@@ -1,5 +1,36 @@
|
||||
package dto
|
||||
|
||||
type AuthorGet struct {
|
||||
Name string `json:"name" binding:"required,max=100"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
type BookSearchGetParam struct {
|
||||
Lang string `form:"lang" binding:"max=5"`
|
||||
}
|
||||
|
||||
type BookPostCreate struct {
|
||||
Title string `json:"title" binding:"required,max=300"`
|
||||
Author string `json:"author" binding:"max=100"`
|
||||
CoverID uint `json:"coverId"`
|
||||
}
|
||||
|
||||
type BookPostImport struct {
|
||||
InventaireID string `json:"inventaireid" binding:"required,max=50"`
|
||||
Lang string `json:"lang" binding:"required,max=5"`
|
||||
}
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
@@ -1,5 +1,30 @@
|
||||
package dto
|
||||
|
||||
type BookGet struct {
|
||||
Title string `json:"title" binding:"required,max=300"`
|
||||
Author string `json:"author" binding:"max=100"`
|
||||
ISBN string `json:"isbn"`
|
||||
InventaireId string `json:"inventaireid"`
|
||||
OpenLibraryId string `json:"openlibraryid"`
|
||||
Summary string `json:"summary"`
|
||||
Rating int `json:"rating"`
|
||||
Read bool `json:"read"`
|
||||
WantRead bool `json:"wantread"`
|
||||
StartReadDate string `json:"startReadDate"`
|
||||
EndReadDate string `json:"endReadDate"`
|
||||
CoverPath string `json:"coverPath"`
|
||||
}
|
||||
|
||||
type BookUserGet 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"`
|
||||
Books []BookSearchGetBook `json:"books"`
|
||||
|
||||
Reference in New Issue
Block a user