You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
555 B
22 lines
555 B
2 weeks ago
|
package data
|
||
|
|
||
|
import "reflect"
|
||
|
|
||
|
type Login struct {
|
||
|
Username string `db:"username" validate:"required,max=30"`
|
||
|
Password string `db:"password" validate:"required,max=128"`
|
||
|
}
|
||
|
|
||
|
type User struct {
|
||
|
Id int `db:"id" json:"id" validate:"numeric"`
|
||
|
Username string `db:"username" validate:"required,max=30"`
|
||
|
Email string `db:"email" validate:"required,email,max=128"`
|
||
|
Password string `db:"password" validate:"required,min=8,max=64"`
|
||
|
}
|
||
|
|
||
|
func Models() map[string]reflect.Type {
|
||
|
return map[string]reflect.Type{
|
||
|
"user": reflect.TypeFor[User](),
|
||
|
}
|
||
|
}
|