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

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

import java.util.List;

/**
 * @ClassName: BuildGroupMenu
 * @Description: 构建用户组
 * @Author: wanggeng
 * @Date: 2022/7/28 23:24
 * @Version: 1.0
 */
@Order
@Component
public class BuildGroupMenu 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/group/list-tree");
        initMenu.setMenuIcon("fa-icon-color-white fa fa-users");
        subMenus.add(initMenu);
        // 更新子菜单
        parentMenu.setSubMenus(subMenus);
    }
}
