package ink.wgink.service.role.init.build;

import ink.wgink.interfaces.init.build.IBuildServiceMenu;
import ink.wgink.pojo.bos.menu.InitMenuBO;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName: BuildRoleMenu
 * @Description: 构建角色菜单
 * @Author: wanggeng
 * @Date: 2022/7/28 23:30
 * @Version: 1.0
 */
@Component
public class BuildRoleMenu implements IBuildServiceMenu {
    @Override
    public void buildMenu(List<InitMenuBO> initMenus) {
        // 获取角色权限管理
        InitMenuBO parentMenu = initMenus.get(2);
        // 获取子菜单
        List<InitMenuBO> subMenus = parentMenu.getSubMenus();
        InitMenuBO initMenu = new InitMenuBO();
        initMenu.setMenuName("角色管理");
        initMenu.setMenuSummary("角色管理");
        initMenu.setMenuUrl("/route/role/list-tree?permissionType=permissionQuery");
        initMenu.setMenuIcon("fa-icon-color-white fa fa-users");
        subMenus.add(initMenu);
        // 更新子菜单
        parentMenu.setSubMenus(subMenus);
    }
}
