Files
ssq-desk/internal/storage/models/authorization.go
2026-01-14 14:17:38 +08:00

21 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package models
import "time"
// Authorization 授权信息
type Authorization struct {
ID int `gorm:"primaryKey" json:"id"` // 主键ID
LicenseCode string `gorm:"type:varchar(100);not null;uniqueIndex" json:"license_code"` // 授权码(唯一)
DeviceID string `gorm:"type:varchar(100);not null;index" json:"device_id"` // 设备IDMD5哈希
ActivatedAt time.Time `gorm:"not null" json:"activated_at"` // 激活时间
ExpiresAt *time.Time `gorm:"type:datetime" json:"expires_at"` // 过期时间可选nil表示永不过期
Status int `gorm:"type:tinyint;not null;default:1" json:"status"` // 状态1:有效 0:无效)
CreatedAt time.Time `gorm:"autoCreateTime:false" json:"created_at"` // 创建时间(由程序设置)
UpdatedAt time.Time `gorm:"autoUpdateTime:false" json:"updated_at"` // 更新时间(由程序设置)
}
// TableName 指定表名
func (Authorization) TableName() string {
return "sys_authorization_code"
}