Nodename search (#484)
* node name search * node name search * node name search * node name search Co-authored-by: alickliming <alickliming@didi.global.com>
This commit is contained in:
parent
e82f560c44
commit
a8008a9418
|
@ -80,6 +80,15 @@ func treeUntilLeafGets(c *gin.Context) {
|
||||||
if strings.Contains(ret[i].Path, arr[0]) {
|
if strings.Contains(ret[i].Path, arr[0]) {
|
||||||
pathSet[ret[i].Path] = struct{}{}
|
pathSet[ret[i].Path] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据节点名搜索
|
||||||
|
if strings.Contains(ret[i].Name, arr[0]) {
|
||||||
|
for j := 0; j < cnt; j++ {
|
||||||
|
if strings.HasPrefix(ret[j].Path, ret[i].Path) {
|
||||||
|
pathSet[ret[j].Path] = struct{}{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -90,6 +99,15 @@ func treeUntilLeafGets(c *gin.Context) {
|
||||||
if !strings.Contains(ret[i].Path, arr[j]) {
|
if !strings.Contains(ret[i].Path, arr[j]) {
|
||||||
match = false
|
match = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据节点名搜索
|
||||||
|
if strings.Contains(ret[i].Name, arr[j]) {
|
||||||
|
for k := 0; k < cnt; k++ {
|
||||||
|
if strings.HasPrefix(ret[k].Path, ret[i].Path) {
|
||||||
|
pathSet[ret[k].Path] = struct{}{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if match {
|
if match {
|
||||||
|
|
Loading…
Reference in New Issue