Files
bibliomane/internal/api/dto.go
Arthur Lefebvre cb1f974f02 Integrate users and books
- new table userbook linking users and book
- moved rating to users book
- updated demo data and tests
- updated front to hide routes from non connected users
2025-10-05 16:14:53 +02:00

23 lines
664 B
Go

package api
type bookPostCreate struct {
Title string `json:"title" binding:"required,max=300"`
Author string `json:"author" binding:"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"`
}
type userLogin struct {
Username string `json:"username" binding:"required,min=2,max=20"`
Password string `json:"password" binding:"required,min=6,max=100"`
}
type bookUserGet struct {
Title string `json:"title" binding:"required,max=300"`
Author string `json:"author" binding:"max=100"`
Rating int `json:"rating" binding:"min=0,max=10"`
}