add readme

This commit is contained in:
2024-07-22 14:31:55 +08:00
parent cc98043aff
commit 8997577181
3 changed files with 121 additions and 3 deletions

View File

@ -130,6 +130,12 @@ func parseUriConfig(methodType reflect.Type, routerPrefix string) (*UriConfig, e
Strict: wrapper.ArrayType([]string{"", "true"}).Has(strings.ToLower(metaField.Tag.Get(TagNameStrict))) >= 0,
FormDataType: methodType.In(2).Elem(),
}
// 校验 FormDataType
for fieldIdx := 0; fieldIdx < uriConfig.FormDataType.NumField(); fieldIdx++ {
if uriConfig.FormDataType.Field(fieldIdx).Type.Kind() == reflect.Interface {
panic("request param set type `interface` is not allowed")
}
}
return uriConfig, nil
}