package model import "time" // WebTicket App→网页免登录的一次性换票凭据(magic-link)。 // App 持 JWT 签票(TTL 60s),浏览器打开 /sso 后凭票兑换正常 web 会话; // 单次可用(used_at 原子置位防重放),票据本身不含任何令牌信息。 type WebTicket struct { ID uint64 `gorm:"primaryKey;autoIncrement" json:"id"` Ticket string `gorm:"size:64;not null;uniqueIndex" json:"-"` ShopID uint64 `gorm:"not null" json:"shop_id"` UserID uint64 `gorm:"not null" json:"user_id"` ExpiresAt time.Time `gorm:"not null;index" json:"expires_at"` UsedAt *time.Time `json:"used_at,omitempty"` CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"` } func (WebTicket) TableName() string { return "web_tickets" }