package ink.wgink.service.user.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: BuildUserMenu
 * @Description: 构建用户菜单
 * @Author: wanggeng
 * @Date: 2022/7/28 23:13
 * @Version: 1.0
 */
@Component
public class BuildUserMenu 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/user/list");
        initMenu.setMenuIcon("fa-icon-color-white fa fa-address-book");
        subMenus.add(initMenu);
        // 更新子菜单
        parentMenu.setSubMenus(subMenus);
    }

}
