package ink.wgink.service.department.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: BuildDepartmentMenu
 * @Description: 构建部门菜单
 * @Author: wanggeng
 * @Date: 2022/7/28 23:21
 * @Version: 1.0
 */
@Component
public class BuildDepartmentMenu implements IBuildServiceMenu {
    @Override
    public void buildMenu(List<InitMenuBO> initMenus) {
        // 获取用户管理
        InitMenuBO parentMenu = initMenus.get(1);
        // 获取子菜单
        List<InitMenuBO> subMenus = parentMenu.getSubMenus();
        InitMenuBO initMenu = new InitMenuBO();
        initMenu.setMenuName("机构部门管理");
        initMenu.setMenuSummary("机构部门管理");
        initMenu.setMenuUrl("/route/department/list-tree");
        initMenu.setMenuIcon("fa-icon-color-white fa fa-bank");
        subMenus.add(initMenu);
        // 更新子菜单
        parentMenu.setSubMenus(subMenus);
    }
}
