style: 监控信息接口

This commit is contained in:
TsMask
2024-08-15 09:38:41 +08:00
parent 1b1c15995d
commit cf1dbf4a0e
2 changed files with 10 additions and 16 deletions

View File

@@ -24,12 +24,13 @@ type SystemInfoController struct {
//
// 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))
}