package ink.wgink.module.dictionary.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: BuildDataMenu
 * @Description: 构建字典菜单
 * @Author: wanggeng
 * @Date: 2022/7/30 15:57
 * @Version: 1.0
 */
@Component
public class BuildDataMenu implements IBuildServiceMenu {

    @Override
    public void buildMenu(List<InitMenuBO> initMenus) {
        // 获取系统管理
        InitMenuBO parentMenu = initMenus.get(0);
        // 获取子菜单
        List<InitMenuBO> subMenus = parentMenu.getSubMenus();
        InitMenuBO initMenu = new InitMenuBO();
        initMenu.setMenuName("数据字典");
        initMenu.setMenuSummary("数据字典");
        initMenu.setMenuUrl("/route/data/list-tree");
        initMenu.setMenuIcon("fa-icon-color-white fa fa-list");
        subMenus.add(initMenu);

        initMenu = new InitMenuBO();
        initMenu.setMenuName("行政区划");
        initMenu.setMenuSummary("行政区划");
        initMenu.setMenuUrl("/route/area/list-tree");
        initMenu.setMenuIcon("fa-icon-color-white fa fa-list");
        subMenus.add(initMenu);

        // 更新子菜单
        parentMenu.setSubMenus(subMenus);
    }
}
