- 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
23 lines
664 B
Go
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"`
|
|
}
|