diff --git a/src/modules/ams/http/router_host_field.go b/src/modules/ams/http/router_host_field.go index a625a658..8409fe4a 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)) }