From 0b4478cf6c0eb509c95a9bec2cc7bda37b259e10 Mon Sep 17 00:00:00 2001
From: 905086 <k2049@qq.com>
Date: Sat, 07 Nov 2026 19:06:06 +0800
Subject: [PATCH] feat: 新增工具管理功能及工具下载安装流程
---
server/models/models.go | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/server/models/models.go b/server/models/models.go
index 4e328fd..1798138 100644
--- a/server/models/models.go
+++ b/server/models/models.go
@@ -37,6 +37,7 @@
GPUReq string `gorm:"size:100" json:"gpu_req"`
RAMReq string `gorm:"size:100" json:"ram_req"`
VersionNote string `gorm:"size:500" json:"version_note"` // V1.685.421顶级版|容量175GB|官方简体中文...
+ LaunchExe string `gorm:"size:255" json:"launch_exe"` // 游戏启动程序相对路径(相对游戏安装目录),如 Binaries\Win64\Game.exe
Cover string `gorm:"size:255" json:"cover"`
Video string `gorm:"size:255" json:"video"`
Screenshots string `gorm:"type:text" json:"screenshots"` // JSON数组
@@ -51,22 +52,24 @@
type Tool struct {
ID uint `gorm:"primaryKey" json:"id"`
Name string `gorm:"size:100" json:"name"`
- Size string `gorm:"size:20" json:"size"`
+ Size string `gorm:"size:20" json:"size"` // 展示用大小,如 85.2MB
Cover string `gorm:"size:255" json:"cover"`
Description string `gorm:"size:500" json:"description"`
- FileURL string `gorm:"size:255" json:"file_url"`
+ FileURL string `gorm:"size:255" json:"file_url"` // 下载压缩包URL
+ LaunchExe string `gorm:"size:255" json:"launch_exe"` // 启动程序相对路径(相对解压后目录)
CreatedAt time.Time `json:"created_at"`
}
type MemberKey struct {
ID uint `gorm:"primaryKey" json:"id"`
Code string `gorm:"uniqueIndex;size:50" json:"code"`
- CardType string `gorm:"size:20" json:"card_type"` // day/month/year
+ CardType string `gorm:"size:20" json:"card_type"` // day/month/year/forever
Status int `json:"status"` // 0未使用 1已使用
+ Frozen bool `gorm:"default:false" json:"frozen"` // 是否冻结(冻结后不可使用)
UserID uint `json:"user_id"`
MachineCode string `gorm:"size:100" json:"machine_code"`
ActivatedAt *time.Time `json:"activated_at"`
- ExpiredAt *time.Time `json:"expired_at"`
+ ExpiredAt *time.Time `json:"expired_at"` // nil 表示永久
ResetCount int `json:"reset_count"`
CreatedAt time.Time `json:"created_at"`
}
@@ -79,6 +82,8 @@
return "月卡"
case "year":
return "年卡"
+ case "forever":
+ return "永久卡"
}
return k.CardType
}
--
Gitblit v1.10.0