From 841e6c36f2571ea10226494db2ed620c95d29b35 Mon Sep 17 00:00:00 2001 From: zhangwei <894646498@qq.com> Date: Sat, 22 Jun 2024 16:54:32 +0800 Subject: [PATCH] screen Former-commit-id: 60c449340e91830d4c3676ac173eb47880938768 --- api/internal/logic/core/getscreenchartlogic.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/internal/logic/core/getscreenchartlogic.go b/api/internal/logic/core/getscreenchartlogic.go index 9723a03c..06085cf9 100644 --- a/api/internal/logic/core/getscreenchartlogic.go +++ b/api/internal/logic/core/getscreenchartlogic.go @@ -25,6 +25,9 @@ func NewGetScreenChartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge func (l *GetScreenChartLogic) GetScreenChart() (resp *types.ScreenChartResp, err error) { resp = &types.ScreenChartResp{} - l.svcCtx.DbEngin.Raw("select * from screen_chart").Scan(&resp) + l.svcCtx.DbEngin.Raw("select cpu_avg from screen_chart").Scan(&resp.CpuAvg) + l.svcCtx.DbEngin.Raw("select cpu_load from screen_chart").Scan(&resp.CpuLoad) + l.svcCtx.DbEngin.Raw("select memory_avg from screen_chart").Scan(&resp.MemoryAvg) + l.svcCtx.DbEngin.Raw("select memory_load from screen_chart").Scan(&resp.MemoryLoad) return }