refactor🎨: 修改错误信息提示

This commit is contained in:
zhangwenjian committed 2021-06-29 16:33:03 +08:00
1 parent f80e64688e
commit dd5f0c52fb
15 files changed
+92 -76

No files matched your search

+2 -2
View File
@@ -34,7 +34,7 @@ func DeleteAction(control dto.Control) gin.HandlerFunc {
var object models.ActiveRecord
object, err = req.GenerateM()
if err != nil {
response.Error(c, http.StatusInternalServerError, err, "模型生成失败")
response.Error(c, 500, err, "模型生成失败")
return
}
@@ -48,7 +48,7 @@ func DeleteAction(control dto.Control) gin.HandlerFunc {
).Where(req.GetId()).Delete(object)
if db.Error != nil {
log.Errorf("MsgID[%s] Delete error: %s", msgID, err)
response.Error(c, http.StatusInternalServerError, err, "删除失败")
response.Error(c, 500, err, "删除失败")
return
}
if db.RowsAffected == 0 {