Files
goimgApi/accounts/models.go
Beyhan Oğur e6f3268c28 first commit
2026-04-26 21:48:15 +03:00

20 lines
628 B
Go

package accounts
import (
"time"
"gorm.io/gorm"
)
type User struct {
ID uint `gorm:"primaryKey" json:"id"`
Email string `gorm:"uniqueIndex;not null" json:"email"`
PasswordHash string `gorm:"not null" json:"-"`
IsAdmin bool `gorm:"default:false" json:"is_admin"`
ApiToken string `gorm:"uniqueIndex" json:"api_token"`
ApiTokenExpiresAt *time.Time `json:"api_token_expires_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}