package com.fs.company.service;

import com.fs.company.domain.CompanyMenu;

import com.fs.company.domain.CompanyMenuTreeSelect;
import com.fs.company.vo.RouterVO;

import java.util.Collection;
import java.util.List;

/**
 * 菜单权限Service接口
 *
 * @author fs
 * @date 2021-05-25
 */
public interface ICompanyMenuService
{
    /**
     * 查询菜单权限
     *
     * @param menuId 菜单权限ID
     * @return 菜单权限
     */
    public CompanyMenu selectCompanyMenuById(Long menuId);

    /**
     * 查询菜单权限列表
     *
     * @param companyMenu 菜单权限
     * @return 菜单权限集合
     */
    public List<CompanyMenu> selectCompanyMenuList(CompanyMenu companyMenu);

    /**
     * 新增菜单权限
     *
     * @param companyMenu 菜单权限
     * @return 结果
     */
    public int insertCompanyMenu(CompanyMenu companyMenu);

    /**
     * 修改菜单权限
     *
     * @param companyMenu 菜单权限
     * @return 结果
     */
    public int updateCompanyMenu(CompanyMenu companyMenu);

    /**
     * 批量删除菜单权限
     *
     * @param menuIds 需要删除的菜单权限ID
     * @return 结果
     */
    public int deleteCompanyMenuByIds(Long[] menuIds);

    /**
     * 删除菜单权限信息
     *
     * @param menuId 菜单权限ID
     * @return 结果
     */
    public int deleteCompanyMenuById(Long menuId);

    List<CompanyMenu> selectMenuTreeByUserId(Long userId, boolean admin);

    List<RouterVO> buildMenus(List<CompanyMenu> menus);

    Collection<? extends String> selectMenuPermsByUserId(Long userId);

    List<CompanyMenu> selectMenuList(CompanyMenu menu, Long userId, String userType);

    List<CompanyMenuTreeSelect> buildMenuTreeSelect(List<CompanyMenu> menus);

    public List<CompanyMenu> buildMenuTree(List<CompanyMenu> menus);

    List<Integer> selectMenuListByRoleId(Long roleId);

    boolean checkMenuExistRole(Long menuId);

    boolean hasChildByMenuId(Long menuId);


}
