Files
FileRelay/internal/model/api_token.go
2026-01-13 17:00:49 +08:00

17 lines
441 B
Go

package model
import (
"time"
)
type APIToken struct {
ID uint `gorm:"primaryKey" json:"id"`
Name string `json:"name"`
TokenHash string `gorm:"uniqueIndex;not null" json:"-"`
Scope string `json:"scope"`
ExpireAt *time.Time `json:"expire_at"`
LastUsedAt *time.Time `json:"last_used_at"`
Revoked bool `gorm:"default:false" json:"revoked"`
CreatedAt time.Time `json:"created_at"`
}