feat ✨: 添加字段验证

This commit is contained in:
wenjianzhang committed 2021-04-08 18:43:17 +08:00
1 parent 221a47423d
commit 14db1e802c
8 files changed
+77 -38

No files matched your search

+2 -2
View File
@@ -27,7 +27,7 @@ func CreateAction(control dto.Control) gin.HandlerFunc {
req := control.Generate()
err = req.Bind(c)
if err != nil {
response.Error(c, http.StatusUnprocessableEntity, err, "参数验证失败")
response.Error(c, http.StatusUnprocessableEntity, err, err.Error())
return
}
var object models.ActiveRecord
@@ -46,4 +46,4 @@ func CreateAction(control dto.Control) gin.HandlerFunc {
response.OK(c, object.GetId(), "创建成功")
c.Next()
}
}
}