From 7c8e509c95c2af0c0d076b13fbbc5aa63a06cb69 Mon Sep 17 00:00:00 2001
From: 905086 <k2049@qq.com>
Date: Sat, 07 Nov 2026 19:35:38 +0800
Subject: [PATCH] chore: 删除无用的测试工具及相关文件
---
server/main.go | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/server/main.go b/server/main.go
index 77abc99..d487db4 100644
--- a/server/main.go
+++ b/server/main.go
@@ -1,6 +1,9 @@
package main
import (
+ "os"
+ "path/filepath"
+
"gamebox-server/config"
"gamebox-server/handlers"
"gamebox-server/middleware"
@@ -9,6 +12,14 @@
)
func main() {
+ // 大文件上传时 multipart 会先写系统临时目录(C盘),
+ // 系统盘空间不足会导致大压缩包上传失败,这里指到程序目录下的 uploads/tmp
+ if abs, err := filepath.Abs(filepath.Join("uploads", "tmp")); err == nil {
+ os.MkdirAll(abs, 0755)
+ os.Setenv("TMP", abs)
+ os.Setenv("TEMP", abs)
+ }
+
config.InitDB()
r := gin.Default()
@@ -28,6 +39,7 @@
api.GET("/games", handlers.GetGames)
api.GET("/banners", handlers.GetBanners)
api.GET("/tools", handlers.GetTools)
+ api.GET("/tools/:id/download", handlers.ToolDownloadInfo)
api.GET("/announcements", handlers.GetAnnouncements)
api.GET("/games/:id", handlers.GetGameDetail) // 支持可选登录
@@ -58,8 +70,13 @@
a.GET("/keys", handlers.ListKeys)
a.POST("/keys/generate", handlers.GenerateKeys)
a.POST("/keys/:id/reset", handlers.ResetKey)
+ a.POST("/keys/:id/freeze", handlers.FreezeKey)
a.DELETE("/keys/:id", handlers.DeleteKey)
+ a.GET("/tools", handlers.AdminListTools)
+ a.POST("/tools", handlers.AdminSaveTool)
+ a.DELETE("/tools/:id", handlers.AdminDeleteTool)
+
a.GET("/games", handlers.AdminListGames)
a.POST("/games", handlers.AdminSaveGame)
a.DELETE("/games/:id", handlers.AdminDeleteGame)
@@ -68,6 +85,9 @@
a.POST("/categories", handlers.AdminSaveCategory)
a.DELETE("/categories/:id", handlers.AdminDeleteCategory)
+ a.GET("/announcement", handlers.AdminGetAnnouncement)
+ a.POST("/announcement", handlers.AdminSaveAnnouncement)
+
a.POST("/upload", handlers.UploadFile)
}
}
--
Gitblit v1.10.0