Files
waf-platform/EdgePlus/pkg/utils/key.go
2026-02-04 20:27:13 +08:00

26 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.

// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package utils
import timeutil "github.com/iwind/TeaGo/utils/time"
type Key struct {
Id string `json:"id"` // 用户ID
DayFrom string `json:"dayFrom"` // 开始日期
DayTo string `json:"dayTo"` // 结束日期
MacAddresses []string `json:"macAddresses"` // MAC地址老的授权方式
RequestCode string `json:"requestCode"` // 授权请求码
Hostname string `json:"hostname"` // 主机名
Company string `json:"company"` // 公司名
Nodes int `json:"nodes"` // 节点数
UpdatedAt int64 `json:"updatedAt"` // 更新时间
Components []ComponentCode `json:"components"` // 组件
Edition Edition `json:"edition"` // 授权版本
Email string `json:"email"` // 联系人邮箱
Method Method `json:"method"` // 验证方法
}
func (this *Key) IsValid() bool {
return this.DayTo >= timeutil.Format("Y-m-d")
}