1
0

merge: 合并代码20241018

This commit is contained in:
TsMask
2024-10-18 17:26:59 +08:00
parent 49860c2f28
commit 17f57175c7
289 changed files with 21476 additions and 12863 deletions

View File

@@ -9,27 +9,27 @@ import (
// 实例化控制层 SystemInfoController 结构体
var NewSystemInfo = &SystemInfoController{
systemInfogService: service.NewSystemInfoImpl,
systemInfogService: service.NewSystemInfo,
}
// 服务器监控信息
//
// PATH /monitor/system-info
type SystemInfoController struct {
// 服务器系统相关信息服务
systemInfogService service.ISystemInfo
systemInfogService *service.SystemInfo // 服务器系统相关信息服务
}
// 服务器信息
//
// GET /
func (s *SystemInfoController) Info(c *gin.Context) {
c.JSON(200, result.OkData(map[string]any{
data := map[string]any{
"cpu": s.systemInfogService.CPUInfo(),
"memory": s.systemInfogService.MemoryInfo(),
"network": s.systemInfogService.NetworkInfo(),
"time": s.systemInfogService.TimeInfo(),
"system": s.systemInfogService.SystemInfo(),
"disk": s.systemInfogService.DiskInfo(),
}))
}
c.JSON(200, result.OkData(data))
}