package model import "time" type License struct { Base ShopID uint64 `gorm:"not null;index" json:"shop_id"` LicenseKey string `gorm:"size:768;uniqueIndex" json:"license_key"` Type string `gorm:"type:enum('trial','monthly','annual','lifetime');default:'trial'" json:"type"` // Tier 当前权益档位(标准/pro/max…),随兑换码写入;当前默认 'standard',暂不据此做能力差异。 Tier string `gorm:"size:32;not null;default:'standard'" json:"tier"` ExpiresAt *time.Time `json:"expires_at"` IsActive bool `gorm:"default:true" json:"is_active"` MaxDevices int `gorm:"default:3" json:"max_devices"` Features JSON `gorm:"type:json" json:"features,omitempty"` // Deprecated: device binding is now tracked in license_devices table. DeviceID string `gorm:"size:255" json:"device_id,omitempty"` ActivatedAt *time.Time `json:"activated_at,omitempty"` }