From ac36c158c02446403775ac58c3159a2cdd7e5894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 26 Jun 2023 16:03:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(meter):=E4=BF=AE=E6=AD=A3=E6=9C=AA=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E8=A1=A8=E8=AE=A1=E7=9A=84=E6=9F=A5=E8=AF=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/meter.go | 6 +++--- vo/meter.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controller/meter.go b/controller/meter.go index 8374ffc..6ef5a3e 100644 --- a/controller/meter.go +++ b/controller/meter.go @@ -300,13 +300,13 @@ func listUnboundMeters(c *fiber.Ctx) error { meterLog.Error("无法列出指定园区中尚未绑定公摊表计的表计,无法获取当前用户会话", zap.Error(err)) return result.Unauthorized(err.Error()) } - parkId := c.Params("pid") - if pass, err := checkParkBelongs(parkId, meterLog, c, &result); !pass { + parkId := tools.EmptyToNil(c.Query("park")) + if pass, err := checkParkBelongs(*parkId, meterLog, c, &result); !pass { return err } keyword := c.Query("keyword") limit := uint(c.QueryInt("limit", 6)) - meters, err := repository.MeterRepository.ListUnboundMeters(session.Uid, &parkId, &keyword, &limit) + meters, err := repository.MeterRepository.ListUnboundMeters(session.Uid, parkId, &keyword, &limit) if err != nil { meterLog.Error("无法列出指定园区中尚未绑定公摊表计的表计,无法获取表计列表", zap.Error(err)) return result.Error(http.StatusInternalServerError, err.Error()) diff --git a/vo/meter.go b/vo/meter.go index 626bb89..1ab3870 100644 --- a/vo/meter.go +++ b/vo/meter.go @@ -44,7 +44,7 @@ type MeterReplacingForm struct { type SimplifiedMeterQueryResponse struct { Code string `json:"code"` Address *string `json:"address"` - Park string `json:"parkId"` + Park string `json:"park"` } type SimplifiedMeterDetailResponse struct {