feature/upgrade_filter #7

Merged
zhangdeman merged 14 commits from feature/upgrade_filter into master 2024-12-02 14:35:30 +08:00
2 changed files with 3 additions and 3 deletions
ce1e7fe9da 修复mapConfig处理错误问题
白茶清欢
2024-11-30 17:31:55 +08:00
Commit 4 of 14
Show all commits

No files matched your search

+1 -1
View File
@@ -151,7 +151,7 @@ func ExpandArrayPath(jsonStr string, pathConfig string, mapConfig string, expend
expendArrayResult.PathMap[pathConfig] = mapConfig
return nil
}
mapConfigArr := strings.Split(pathConfig, ArrayIdxTpl)
mapConfigArr := strings.Split(mapConfig, ArrayIdxTpl)
mapConfigArr[0] = strings.TrimSuffix(mapConfigArr[0], ".")
mapSuffixPathTpl := strings.TrimPrefix(strings.Join(mapConfigArr[1:], ArrayIdxTpl), ".")
+2 -2
View File
@@ -171,8 +171,8 @@ func TestExpandArrayPath(t *testing.T) {
PathMap: nil,
}
ExpandArrayPath(jsonStr, "user_list.{{idx}}.{{idx}}.age", "a.{{idx}}.{{idx}}.b", pathExpendRes)
ExpandArrayPath(jsonStr, "user_list.{{idx}}.{{idx}}.name", "a.{{idx}}.{{idx}}.c", pathExpendRes)
ExpandArrayPath(jsonStr, "user_list.{{idx}}.{{idx}}.sex", "a.{{idx}}.{{idx}}.c", pathExpendRes)
ExpandArrayPath(jsonStr, "user_list.{{idx}}.{{idx}}.name", "e.{{idx}}.{{idx}}.c", pathExpendRes)
ExpandArrayPath(jsonStr, "user_list.{{idx}}.{{idx}}.sex", "f.{{idx}}.{{idx}}.c", pathExpendRes)
res := ""
for _, item := range pathExpendRes.PathList {
res, _ = sjson.Set(res, pathExpendRes.PathMap[item], gjson.Get(jsonStr, item).Value())
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.