.
This commit is contained in:
20
internal/storage/models/authorization.go
Normal file
20
internal/storage/models/authorization.go
Normal file
@@ -0,0 +1,20 @@
|
||||
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"` // 设备ID(MD5哈希)
|
||||
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"
|
||||
}
|
||||
24
internal/storage/models/ssq_history.go
Normal file
24
internal/storage/models/ssq_history.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SsqHistory 双色球历史开奖数据
|
||||
type SsqHistory struct {
|
||||
ID int `gorm:"primaryKey;column:id" json:"id"`
|
||||
IssueNumber string `gorm:"type:varchar(20);not null;index;column:issue_number" json:"issue_number"`
|
||||
OpenDate *time.Time `gorm:"type:date;column:open_date" json:"open_date"`
|
||||
RedBall1 int `gorm:"type:tinyint;not null;column:red_ball_1" json:"red_ball_1"`
|
||||
RedBall2 int `gorm:"type:tinyint;not null;column:red_ball_2" json:"red_ball_2"`
|
||||
RedBall3 int `gorm:"type:tinyint;not null;column:red_ball_3" json:"red_ball_3"`
|
||||
RedBall4 int `gorm:"type:tinyint;not null;column:red_ball_4" json:"red_ball_4"`
|
||||
RedBall5 int `gorm:"type:tinyint;not null;column:red_ball_5" json:"red_ball_5"`
|
||||
RedBall6 int `gorm:"type:tinyint;not null;column:red_ball_6" json:"red_ball_6"`
|
||||
BlueBall int `gorm:"type:tinyint;not null;column:blue_ball" json:"blue_ball"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime:false;column:created_at" json:"created_at"` // 创建时间(由程序设置)
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime:false;column:updated_at" json:"updated_at"` // 更新时间(由程序设置)
|
||||
}
|
||||
|
||||
// TableName 指定表名
|
||||
func (SsqHistory) TableName() string {
|
||||
return "ssq_history"
|
||||
}
|
||||
20
internal/storage/models/version.go
Normal file
20
internal/storage/models/version.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// Version 版本信息
|
||||
type Version struct {
|
||||
ID int `gorm:"primaryKey" json:"id"` // 主键ID
|
||||
Version string `gorm:"type:varchar(20);not null;uniqueIndex" json:"version"` // 版本号(语义化版本,如1.0.0)
|
||||
DownloadURL string `gorm:"type:varchar(500)" json:"download_url"` // 下载地址(更新包下载URL)
|
||||
Changelog string `gorm:"type:text" json:"changelog"` // 更新日志(Markdown格式)
|
||||
ForceUpdate int `gorm:"type:tinyint;not null;default:0" json:"force_update"` // 是否强制更新(1:是 0:否)
|
||||
ReleaseDate *time.Time `gorm:"type:date" json:"release_date"` // 发布日期
|
||||
CreatedAt time.Time `gorm:"autoCreateTime:false" json:"created_at"` // 创建时间(由程序设置)
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime:false" json:"updated_at"` // 更新时间(由程序设置)
|
||||
}
|
||||
|
||||
// TableName 指定表名
|
||||
func (Version) TableName() string {
|
||||
return "sys_version"
|
||||
}
|
||||
Reference in New Issue
Block a user