mirror of
https://github.com/lkmio/gb-cms.git
synced 2025-11-03 01:43:44 +08:00
feat: 适配级联相关接口
This commit is contained in:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user