Files
gfast/app/model/admin/model_fields/model_rules.go
T
2020-09-07 16:49:47 +08:00

25 lines
665 B
Go

package model_fields
import "github.com/gogf/gf/frame/g"
//模型字段规则
type FieldRule struct {
FType string `json:"type"`
FTitle string `json:"title"`
FField string `json:"field"`
FValue interface{} `json:"value"`
FOptions g.List `json:"options"`
FAttr g.Map `json:"attr"` //设置组件普通的 HTML 特性
FProps g.Map `json:"props"`
FValidate []Validate `json:"validate"`
}
//字段验证规则
type Validate struct {
VType string `json:"type"`
VRequired bool `json:"required"`
VMessage string `json:"message"`
VMin int64 `json:"min"`
VTrigger string `json:"trigger"`
}