package models import ( "time" "github.com/google/uuid" "gorm.io/gorm" ) type User struct { ID uuid.UUID `gorm:"primaryKey;type:uuid;default:gen_random_uuid()" json:"id"` Username string `gorm:"size:100;uniqueIndex;not null" json:"username"` Password string `gorm:"not null" json:"-"` Role string `gorm:"default:'user';not null" json:"role"` AccountName string `gorm:"size:100;default:'Default Device'" json:"account_name"` JID string `gorm:"column:jid;size:255" json:"jid"` IsActive bool `gorm:"default:false" json:"is_active"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"` } func (User) TableName() string { return "users" } type RefreshToken struct { ID uuid.UUID `gorm:"primaryKey;type:uuid;default:gen_random_uuid()" json:"id"` UserID uuid.UUID `gorm:"type:uuid;not null" json:"user_id"` Token string `gorm:"uniqueIndex;not null" json:"token"` ExpiresAt time.Time `json:"expires_at"` CreatedAt time.Time `json:"created_at"` } func (RefreshToken) TableName() string { return "refresh_tokens" } type Setting struct { Key string `gorm:"primaryKey;size:255" json:"key"` Value string `gorm:"type:text" json:"value"` } func (Setting) TableName() string { return "settings" }