23 lines
747 B
Go
23 lines
747 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type User struct {
|
|
gorm.Model
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Email string `gorm:"uniqueIndex;not null" json:"email"`
|
|
Password string `gorm:"not null" json:"-"`
|
|
FirstName string `json:"first_name"`
|
|
LastName string `json:"last_name"`
|
|
Role string `gorm:"default:user" json:"role"` // user, admin
|
|
IsActive bool `gorm:"default:true" json:"is_active"`
|
|
LastLogin time.Time `json:"last_login"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// Другие модели будут добавлены позже
|
|
// type Profile {}, type Event {}, type Review {}, etc. |