package com.judong.chuanyiserver.dao;

import com.judong.chuanyiserver.entity.Menu;
import com.judong.chuanyiserver.entity.Role;
import com.judong.chuanyiserver.util.Result;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleDao {

    Role getRoleByName(String roleName);

    Integer addRole(Role role);

    Role getRoleByNoIdName(int id, String roleName);

    Integer updateRole(Role role);

    Long getRoleCount(String roleName, String roleCode, Integer noDelete);

    List<Role> getRoleListByPage(Long startNum, Long limitNum, String roleName, String roleCode, Integer noDelete);

    Role getRoleById(Integer id);

    List<Menu> getMenuListByroleList(List<Role> roleList);

    Integer deleteRoleById(Integer roleId, Integer publicIsDelete);

    List<Menu> getShareMenuList(Integer roleId, List<Menu> menuList);

    Integer deleteRoleMenuByRoleId(Integer roleId);

    List<Menu> getNoShareOldMenuList(Integer roleId, List<Menu> menuList);

    Integer deleteRoleMenu(Integer roleId, List<Menu> menuList);

    Integer addRoleMenuList(Integer roleId, List<Menu> menuList);

    List<Menu> getMenuByRoleIdList(List<Integer> roleIdList, Integer menuAvailable);
}
