初始化2

This commit is contained in:
2026-07-10 17:33:33 +08:00
parent b51ee98afa
commit 94f6ecf901
59 changed files with 3893 additions and 980 deletions

View File

@@ -10,6 +10,24 @@ import (
"github.com/gin-gonic/gin"
)
// GetSystemLogs 获取系统运行日志
// GET /api/admin/monitor/logs?limit=200
func (c *MonitorController) GetSystemLogs(ctx *gin.Context) {
limit := 200
if l, err := parseIntQuery(ctx, "limit"); err == nil && l > 0 {
limit = l
}
if limit > 2000 {
limit = 2000
}
entries := utils.LogBuf.Get(limit)
utils.Success(ctx, gin.H{
"total": utils.LogBuf.Count(),
"entries": entries,
})
}
// MonitorController 监控控制器
type MonitorController struct {
fileRepo *repository.FileRepository