Files
Trackeep/backend/models/browser_extension.go
T
Tomas Dvorak 083373a24f feat: major feature updates and cleanup
- Add Redis architecture implementation
- Update browser extension functionality
- Clean up deprecated files and documentation
- Enhance backend handlers for auth, messages, search
- Add new configuration options and settings
- Update Docker and deployment configurations
2026-03-03 11:03:37 +01:00

34 lines
1.4 KiB
Go

package models
import (
"time"
)
// APIKey represents an API key for browser extension
type APIKey struct {
ID uint `json:"id" gorm:"primaryKey"`
Name string `json:"name" gorm:"not null"`
Key string `json:"key" gorm:"not null;uniqueIndex"`
UserID uint `json:"user_id" gorm:"not null"`
Permissions []string `json:"permissions" gorm:"serializer:json"`
IsActive bool `json:"is_active" gorm:"default:true"`
LastUsed *time.Time `json:"last_used,omitempty" gorm:"not null"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
ExpiresAt *time.Time `json:"expires_at,omitempty" gorm:"not null"`
User User `json:"user,omitempty" gorm:"foreignKey:UserID"`
}
// BrowserExtension represents a browser extension registration
type BrowserExtension struct {
ID uint `json:"id" gorm:"primaryKey"`
UserID uint `json:"user_id" gorm:"not null"`
ExtensionID string `json:"extension_id" gorm:"not null"`
Name string `json:"name" gorm:"not null"`
IsActive bool `json:"is_active" gorm:"default:true"`
LastSeen *time.Time `json:"last_seen,omitempty" gorm:"not null"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
User User `json:"user,omitempty" gorm:"foreignKey:UserID"`
}