We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
menu shcema 中的 SplitParentIDs 方法是什么用途?
// SplitParentIDs 拆分父级路径的唯一标识列表 func (a Menus) SplitParentIDs() []string { idList := make([]string, 0, len(a)) mIDList := make(map[string]struct{}) for _, item := range a { if _, ok := mIDList[item.ID]; ok || item.ParentPath == "" { continue } for _, pp := range strings.Split(item.ParentPath, "/") { if _, ok := mIDList[pp]; ok { continue } idList = append(idList, pp) mIDList[pp] = struct{}{} } } return idList }
ParentPath 是将父路径拆分了, 而 idlist 存放的是 菜单的 uuid, 作者这么做的用意是啥?
另外在代码中唯一引用该方法SplitParentIDs的地方, 理论上拆分路径的查询是不成立的吧
SplitParentIDs
var qIDs []string for _, pid := range menuResult.Data.SplitParentIDs() { if _, ok := mData[pid]; !ok { qIDs = append(qIDs, pid) } } if len(qIDs) > 0 { pmenuResult, err := a.MenuModel.Query(ctx, schema.MenuQueryParam{ IDs: menuResult.Data.SplitParentIDs(), }) if err != nil { return nil, err } menuResult.Data = append(menuResult.Data, pmenuResult.Data...) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
menu shcema 中的 SplitParentIDs 方法是什么用途?
ParentPath 是将父路径拆分了, 而 idlist 存放的是 菜单的 uuid, 作者这么做的用意是啥?
另外在代码中唯一引用该方法
SplitParentIDs
的地方, 理论上拆分路径的查询是不成立的吧The text was updated successfully, but these errors were encountered: