Browse Source

新增指标不存在校验

tuoling805 1 year ago
parent
commit
f2518feb9f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      controllers/edb_info.go

+ 6 - 0
controllers/edb_info.go

@@ -142,6 +142,12 @@ func (this *EdbInfoController) EdbIndexDetail() {
 	}
 	detail, err := models.GetEdbInfoOnlyByEdbCode(req.EdbCode)
 	if err != nil {
+		if err.Error() == utils.ErrNoRow() {
+			br.Msg = "指标数据不存在!"
+			br.ErrMsg = "指标数据不存在,Err:" + err.Error()
+			br.ErrCode = "400"
+			return
+		}
 		br.Msg = "获取数据失败!"
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
 		return