2025-04-01 17:57:35 +08:00

17 lines
357 B
Go

package convertor
import (
"sort"
"strings"
"management/internal/pkg/sliceutil"
)
func HandleParentPath(parentPath string) string {
parentPath = strings.ReplaceAll(parentPath, ",,", ",")
paths := sliceutil.RemoveDuplicatesWithMap(strings.Split(parentPath, ","))
sort.Strings(paths)
parentPath = strings.Join(paths, ",") + ","
return parentPath
}