All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tinygroup.menutree.manager.MenuTreeManager Maven / Gradle / Ivy

The newest version!
package org.tinygroup.menutree.manager;

import org.tinygroup.menutree.config.Menu;
import org.tinygroup.menutree.dto.MenuInfo;
import org.tinygroup.menutree.dto.MenuNode;
import org.tinygroup.menutree.util.MenuUtil;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by wangwy11342 on 2016/10/18.
 */
public interface MenuTreeManager {
    /**
     * 加载菜单列表
     * @param menuList
     */
    void load(List menuList);

    /**
     *根据当前的url获取整棵树的MenuInfo(不管权限)
     * @param currentUrl
     * @return
     */
    MenuInfo getAllMenuInfo(String currentUrl);

    /**
     *根据当前的url和用户的权限((不一定是连续的,可能只是个叶子节点)获取整棵树的MenuInfo
     * @param authMenuList
     * @param currentUrl
     * @return
     */
    MenuInfo getAuthMenuInfoByAuthMenus(List authMenuList, String currentUrl);

    /**
     *根据当前的url和用户的权限id((不一定是连续的,可能只是个叶子节点)获取整棵树的MenuInfo
     * @param authMenuIdList
     * @param currentUrl
     * @return
     */
    MenuInfo getAuthMenuInfo(List authMenuIdList, String currentUrl);

    /**
     * 根据当前的权限列表获取所有的菜单node
     * @param authMenuIdList 从用户的菜单id列表(不一定是连续的,可能只是个叶子节点)
     * @return 返回的结构包含整个树的结构
     */
    List getAuthMenuNodeList(List authMenuIdList);

    /**
     *根据当前的权限列表以及传入的所有菜单获取所有的菜单node
     * 一般用于不通过load加载直接获取权限菜单的方式
     * @param allMenuList 所有菜单
     * @param authMenuIdList 用户有权限的菜单id
     * @return
     */
    List getAuthMenuNodeList(List allMenuList,List authMenuIdList);

    /**
     * 根据用户的权限树和当前url获取MenuInfo
     * @param currentUrl
     * @param authMenuNodeList
     * @return
     */
    MenuInfo getAuthMenuInfo(String currentUrl,List authMenuNodeList);


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy