forked from free-lancers/electricity_bill_calc_service
		
	fix(meter):在按照编号列表获取表计详细的时候,对于表计编号列表是空的防御措施。
This commit is contained in:
		@@ -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) {
 | 
					func (mr _MeterRepository) ListMetersByIDs(pid string, ids []string) ([]*model.MeterDetail, error) {
 | 
				
			||||||
	mr.log.Info("列出指定园区中指定列表中所有表计的详细信息", zap.String("park id", pid), zap.Strings("meter ids", ids))
 | 
						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()
 | 
						ctx, cancel := global.TimeoutContext()
 | 
				
			||||||
	defer cancel()
 | 
						defer cancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user