diff --git a/src/modules/ams/http/router_host_field.go b/src/modules/ams/http/router_host_field.go index a625a6580a1723f43deb84e2be4b11725745fb80..8409fe4accab61bf359dbd7f673bfa98e4811968 100644 --- a/src/modules/ams/http/router_host_field.go +++ b/src/modules/ams/http/router_host_field.go @@ -12,6 +12,22 @@ func hostFieldNew(c *gin.Context) { var obj models.HostField bind(c, &obj) + if obj.FieldIdent == "" { + bomb("field_ident is blank") + } + + if obj.FieldName == "" { + bomb("field_name is blank") + } + + if obj.FieldType == "" { + bomb("field_type is blank") + } + + if obj.FieldCate == "" { + obj.FieldCate = "Default" + } + renderMessage(c, models.HostFieldNew(&obj)) }