|
@@ -39,6 +39,10 @@ type IFielderPost interface {
|
|
|
RestFieldsPost(result json.Map, files map[string]IReadCloserLen, names FieldList)
|
|
|
}
|
|
|
|
|
|
+type IFieldChecker interface {
|
|
|
+ RestFieldCheck(fieldName string) bool
|
|
|
+}
|
|
|
+
|
|
|
func fieldsDefault(t reflect.Type) (res []any) {
|
|
|
for i := 0; i < t.NumField(); i++ {
|
|
|
fType := t.Field(i)
|
|
@@ -144,6 +148,11 @@ func fieldVal(val reflect.Value, fieldName string, files RequestFiles, names ...
|
|
|
}
|
|
|
}
|
|
|
if !field.IsValid() {
|
|
|
+ if f, check := val.Interface().(IFieldChecker); check {
|
|
|
+ if check := f.RestFieldCheck(fieldName); check {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
err = ErrorFiled(rField.Name, "field is not found")
|
|
|
return false
|
|
|
}
|