feat: 适配级联相关接口

This commit is contained in:
ydajiang
2025-09-05 10:18:12 +08:00
parent 17f3007f86
commit cd5fa263a5
16 changed files with 825 additions and 495 deletions

View File

@@ -27,6 +27,16 @@ func parseQueryParams(c func(key string) string, v interface{}) (interface{}, er
field := typ.Field(i)
fieldValue := val.Field(i)
// 处理组合字段
if field.Anonymous {
embedded := reflect.New(field.Type).Elem()
if _, err := parseQueryParams(c, embedded.Addr().Interface()); err != nil {
return nil, err
}
fieldValue.Set(embedded)
continue
}
// 获取字段名
fieldName := field.Tag.Get("json")
if fieldName == "" {