fix(meter):修正未绑定表计的查询。
This commit is contained in:
parent
037e6258d1
commit
ac36c158c0
|
@ -300,13 +300,13 @@ func listUnboundMeters(c *fiber.Ctx) error {
|
||||||
meterLog.Error("无法列出指定园区中尚未绑定公摊表计的表计,无法获取当前用户会话", zap.Error(err))
|
meterLog.Error("无法列出指定园区中尚未绑定公摊表计的表计,无法获取当前用户会话", zap.Error(err))
|
||||||
return result.Unauthorized(err.Error())
|
return result.Unauthorized(err.Error())
|
||||||
}
|
}
|
||||||
parkId := c.Params("pid")
|
parkId := tools.EmptyToNil(c.Query("park"))
|
||||||
if pass, err := checkParkBelongs(parkId, meterLog, c, &result); !pass {
|
if pass, err := checkParkBelongs(*parkId, meterLog, c, &result); !pass {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
keyword := c.Query("keyword")
|
keyword := c.Query("keyword")
|
||||||
limit := uint(c.QueryInt("limit", 6))
|
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 {
|
if err != nil {
|
||||||
meterLog.Error("无法列出指定园区中尚未绑定公摊表计的表计,无法获取表计列表", zap.Error(err))
|
meterLog.Error("无法列出指定园区中尚未绑定公摊表计的表计,无法获取表计列表", zap.Error(err))
|
||||||
return result.Error(http.StatusInternalServerError, err.Error())
|
return result.Error(http.StatusInternalServerError, err.Error())
|
||||||
|
|
|
@ -44,7 +44,7 @@ type MeterReplacingForm struct {
|
||||||
type SimplifiedMeterQueryResponse struct {
|
type SimplifiedMeterQueryResponse struct {
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Address *string `json:"address"`
|
Address *string `json:"address"`
|
||||||
Park string `json:"parkId"`
|
Park string `json:"park"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SimplifiedMeterDetailResponse struct {
|
type SimplifiedMeterDetailResponse struct {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user