forked from free-lancers/electricity_bill_calc_service
fix(report):修复因为没有找到园区概览而出现的错误。
This commit is contained in:
@@ -28,6 +28,10 @@ func ensureReportBelongs(c *gin.Context, result *response.Result, requestReportI
|
||||
result.NotFound(err.Error())
|
||||
return false
|
||||
}
|
||||
if requestReport == nil {
|
||||
result.NotFound("指定报表未能找到。")
|
||||
return false
|
||||
}
|
||||
return ensureParkBelongs(c, result, requestReport.ParkId)
|
||||
}
|
||||
|
||||
@@ -105,5 +109,9 @@ func fetchReportParkSummary(c *gin.Context) {
|
||||
result.NotFound(err.Error())
|
||||
return
|
||||
}
|
||||
if summary == nil {
|
||||
result.NotFound("指定报表未能找到。")
|
||||
return
|
||||
}
|
||||
result.Json(http.StatusOK, "已经获取到指定报表中的园区概况。", gin.H{"summary": summary})
|
||||
}
|
||||
|
Reference in New Issue
Block a user