feat: 合并Gin_Vue
This commit is contained in:
36
src/modules/monitor/controller/system_info.go
Normal file
36
src/modules/monitor/controller/system_info.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"ems.agt/src/framework/vo/result"
|
||||
"ems.agt/src/modules/monitor/service"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// 实例化控制层 SystemInfoController 结构体
|
||||
var NewSystemInfo = &SystemInfoController{
|
||||
systemInfogService: service.NewSystemInfoImpl,
|
||||
}
|
||||
|
||||
// 服务器监控信息
|
||||
//
|
||||
// PATH /monitor/system-info
|
||||
type SystemInfoController struct {
|
||||
// 服务器系统相关信息服务
|
||||
systemInfogService service.ISystemInfo
|
||||
}
|
||||
|
||||
// 服务器信息
|
||||
//
|
||||
// GET /
|
||||
func (s *SystemInfoController) Info(c *gin.Context) {
|
||||
c.JSON(200, result.OkData(map[string]any{
|
||||
"project": s.systemInfogService.ProjectInfo(),
|
||||
"cpu": s.systemInfogService.CPUInfo(),
|
||||
"memory": s.systemInfogService.MemoryInfo(),
|
||||
"network": s.systemInfogService.NetworkInfo(),
|
||||
"time": s.systemInfogService.TimeInfo(),
|
||||
"system": s.systemInfogService.SystemInfo(),
|
||||
"disk": s.systemInfogService.DiskInfo(),
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user