|
@@ -298,29 +298,31 @@ func validateData(handler HTTPServerHandler) bool {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
value := reflect.ValueOf(handler.Data)
|
|
value := reflect.ValueOf(handler.Data)
|
|
|
- fmt.Println(value.Kind())
|
|
|
|
|
if value.Kind() != reflect.Ptr {
|
|
if value.Kind() != reflect.Ptr {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
value = value.Elem()
|
|
value = value.Elem()
|
|
|
- fmt.Println(value.Kind())
|
|
|
|
|
if value.Kind() != reflect.Struct {
|
|
if value.Kind() != reflect.Struct {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for field := range value.Fields() {
|
|
for field := range value.Fields() {
|
|
|
|
|
+ fmt.Println(field.Name)
|
|
|
validators, ok := handler.Validators[field.Name]
|
|
validators, ok := handler.Validators[field.Name]
|
|
|
if !ok {
|
|
if !ok {
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ fmt.Println(len(validators))
|
|
|
if len(validators) == 0 {
|
|
if len(validators) == 0 {
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for _, validator := range validators {
|
|
for _, validator := range validators {
|
|
|
|
|
+ fmt.Println(value.Elem())
|
|
|
if validator.Validate(value.Interface()) {
|
|
if validator.Validate(value.Interface()) {
|
|
|
|
|
+ fmt.Println(len(validators))
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
|
|
|