initial
This commit is contained in:
16
internal/database/model_apikey.go
Normal file
16
internal/database/model_apikey.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package database
|
||||
|
||||
import "time"
|
||||
|
||||
// APIKey represents an API key for a user
|
||||
type APIKey struct {
|
||||
BaseModel
|
||||
|
||||
UserID string `gorm:"type:uuid;not null" json:"user_id"`
|
||||
Key string `gorm:"uniqueIndex;not null" json:"key"`
|
||||
Description string `json:"description"`
|
||||
LastUsedAt *time.Time `json:"last_used_at,omitempty"`
|
||||
|
||||
// Relations
|
||||
User User `json:"user,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user