Former-commit-id: 60c449340e91830d4c3676ac173eb47880938768
This commit is contained in:
zhangwei 2024-06-22 16:54:32 +08:00
parent 6f1edf393e
commit 841e6c36f2
1 changed files with 4 additions and 1 deletions

View File

@ -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
}