model_rules.go 665 B

123456789101112131415161718192021222324
  1. package model_fields
  2. import "github.com/gogf/gf/frame/g"
  3. //模型字段规则
  4. type FieldRule struct {
  5. FType string `json:"type"`
  6. FTitle string `json:"title"`
  7. FField string `json:"field"`
  8. FValue interface{} `json:"value"`
  9. FOptions g.List `json:"options"`
  10. FAttr g.Map `json:"attr"` //设置组件普通的 HTML 特性
  11. FProps g.Map `json:"props"`
  12. FValidate []Validate `json:"validate"`
  13. }
  14. //字段验证规则
  15. type Validate struct {
  16. VType string `json:"type"`
  17. VRequired bool `json:"required"`
  18. VMessage string `json:"message"`
  19. VMin int64 `json:"min"`
  20. VTrigger string `json:"trigger"`
  21. }