mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 15:44:21 +00:00
Use InsertStruct
This commit is contained in:
@@ -20,13 +20,13 @@ const (
|
||||
|
||||
// User represents a user in the system
|
||||
type User struct {
|
||||
ID int `json:"id" validate:"required,min=1"`
|
||||
Email string `json:"email" validate:"required,email"`
|
||||
DisplayName string `json:"displayName"`
|
||||
PasswordHash string `json:"-"`
|
||||
Role UserRole `json:"role" validate:"required,oneof=admin editor viewer"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
LastWorkspaceID int `json:"lastWorkspaceId"`
|
||||
ID int `json:"id" db:"id,default" validate:"required,min=1"`
|
||||
Email string `json:"email" db:"email" validate:"required,email"`
|
||||
DisplayName string `json:"displayName" db:"display_name"`
|
||||
PasswordHash string `json:"-" db:"password_hash"`
|
||||
Role UserRole `json:"role" db:"role" validate:"required,oneof=admin editor viewer"`
|
||||
CreatedAt time.Time `json:"createdAt" db:"created_at,default"`
|
||||
LastWorkspaceID int `json:"lastWorkspaceId" db:"last_workspace_id"`
|
||||
}
|
||||
|
||||
// Validate validates the user struct
|
||||
|
||||
Reference in New Issue
Block a user