|
@@ -3,7 +3,6 @@ package rest
|
|
import (
|
|
import (
|
|
"errors"
|
|
"errors"
|
|
"fmt"
|
|
"fmt"
|
|
- "log"
|
|
|
|
"reflect"
|
|
"reflect"
|
|
"strings"
|
|
"strings"
|
|
|
|
|
|
@@ -148,17 +147,7 @@ func fieldVal(val reflect.Value, fieldName string, files RequestFiles, names ...
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if !field.IsValid() {
|
|
if !field.IsValid() {
|
|
- /*
|
|
|
|
- log.Println("invalid")
|
|
|
|
- log.Printf("%T\n", val.Interface())
|
|
|
|
- if f, check := val.Interface().(IFieldChecker); check {
|
|
|
|
- log.Println("ifieldchecker")
|
|
|
|
- if check := f.RestFieldCheck(fieldName); check {
|
|
|
|
- return true
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- err = ErrorFiled(rField.Name, "field is not found")
|
|
|
|
- */
|
|
|
|
|
|
+ // возвращаем true потому что поле может быть кастомным и объявлено позже, если объект реализовн как интерфейс RestFileldsPost
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
var fVal reflect.Value
|
|
var fVal reflect.Value
|
|
@@ -303,9 +292,7 @@ func OutFields(req IRequestIn, obj any, files RequestFiles, names ...any) IReque
|
|
|
|
|
|
func OutFieldsReq(req IRequestIn, obj any, files RequestFiles, names ...any) IRequestOut {
|
|
func OutFieldsReq(req IRequestIn, obj any, files RequestFiles, names ...any) IRequestOut {
|
|
if len(names) == 0 {
|
|
if len(names) == 0 {
|
|
- log.Println("names check...")
|
|
|
|
names = req.RData().Slice("fields", nil)
|
|
names = req.RData().Slice("fields", nil)
|
|
}
|
|
}
|
|
- log.Println("NAMES....", names)
|
|
|
|
return OutFields(req, obj, files, names...)
|
|
return OutFields(req, obj, files, names...)
|
|
}
|
|
}
|