fix(meter):修正未绑定表计的查询。

This commit is contained in:
徐涛 2023-06-26 16:03:57 +08:00
parent 037e6258d1
commit ac36c158c0
2 changed files with 4 additions and 4 deletions

View File

@ -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())

View File

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