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 }