From b224f516136389d8f53c437cd63028706954963f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 26 Jun 2023 16:22:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(meter):=E5=9C=A8=E6=8C=89=E7=85=A7=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E5=88=97=E8=A1=A8=E8=8E=B7=E5=8F=96=E8=A1=A8=E8=AE=A1?= =?UTF-8?q?=E8=AF=A6=E7=BB=86=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E4=BA=8E=E8=A1=A8=E8=AE=A1=E7=BC=96=E5=8F=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=98=AF=E7=A9=BA=E7=9A=84=E9=98=B2=E5=BE=A1=E6=8E=AA=E6=96=BD?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repository/meter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/repository/meter.go b/repository/meter.go index 2c01db4..c0d3a00 100644 --- a/repository/meter.go +++ b/repository/meter.go @@ -185,6 +185,9 @@ func (mr _MeterRepository) MetersIn(pid string, page uint, keyword *string) ([]* // 列出指定园区中指定列表中所有表计的详细信息,将忽略所有表计的当前状态 func (mr _MeterRepository) ListMetersByIDs(pid string, ids []string) ([]*model.MeterDetail, error) { mr.log.Info("列出指定园区中指定列表中所有表计的详细信息", zap.String("park id", pid), zap.Strings("meter ids", ids)) + if len(ids) == 0 { + return make([]*model.MeterDetail, 0), nil + } ctx, cancel := global.TimeoutContext() defer cancel()