package ink.wgink.module.file.init.build;

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

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: BuildFileMenu
 * @Description: 构建文件菜单
 * @Author: wanggeng
 * @Date: 2022/8/2 17:17
 * @Version: 1.0
 */
@Component
public class BuildFileMenu implements IBuildServiceMenu {

    @Override
    public void buildMenu(List<InitMenuBO> initMenus) {
        InitMenuBO fileParentMenu = new InitMenuBO();
        fileParentMenu.setMenuName("文件管理");
        fileParentMenu.setMenuSummary("文件管理");

        // 获取子菜单
        List<InitMenuBO> subMenus = new ArrayList<>();
        InitMenuBO initMenu = new InitMenuBO();
        initMenu.setMenuName("上传文件");
        initMenu.setMenuSummary("上传文件");
        initMenu.setMenuUrl("/route/file/v2/list");
        subMenus.add(initMenu);

        // 设置子菜单
        fileParentMenu.setSubMenus(subMenus);
        // 更新子菜单
        initMenus.add(fileParentMenu);
    }

}
