mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 07:54:22 +00:00
17 lines
387 B
Go
17 lines
387 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type User struct {
|
|
ID int `json:"id" validate:"required,min=1"`
|
|
Username string `json:"username" validate:"required"`
|
|
Email string `json:"email" validate:"required,email"`
|
|
PasswordHash string `json:"-"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
func (u *User) Validate() error {
|
|
return validate.Struct(u)
|
|
} |