feat: 合并Gin_Vue

This commit is contained in:
TsMask
2023-10-16 17:10:38 +08:00
parent 5289818fd4
commit 40a32cb67f
203 changed files with 19719 additions and 178 deletions

View 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(),
}))
}