refactor: 会话失效、数据权限和实时推送重构
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package com.youlai.boot.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.youlai.boot.system.model.entity.RoleDept;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色部门关联持久层
|
||||
*
|
||||
* @author Ray.Hao
|
||||
* @since 3.0.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface RoleDeptMapper extends BaseMapper<RoleDept> {
|
||||
|
||||
/**
|
||||
* 根据角色ID获取部门ID列表
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 部门ID列表
|
||||
*/
|
||||
List<Long> getDeptIdsByRoleId(@Param("roleId") Long roleId);
|
||||
|
||||
/**
|
||||
* 根据角色编码集合获取所有部门ID列表(用于自定义数据权限)
|
||||
*
|
||||
* @param roleCodes 角色编码集合
|
||||
* @return 部门ID列表
|
||||
*/
|
||||
List<Long> getDeptIdsByRoleCodes(@Param("roleCodes") List<String> roleCodes);
|
||||
|
||||
}
|
||||
@@ -3,7 +3,10 @@ package com.youlai.boot.system.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.youlai.boot.system.model.entity.Role;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -22,4 +25,15 @@ public interface RoleMapper extends BaseMapper<Role> {
|
||||
* @return {@link Integer} – 数据权限范围
|
||||
*/
|
||||
Integer getMaximumDataScope(Set<String> roles);
|
||||
|
||||
/**
|
||||
* 获取角色的数据权限信息列表
|
||||
* <p>
|
||||
* 返回角色编码和数据权限范围的映射列表
|
||||
*
|
||||
* @param roleCodes 角色编码集合
|
||||
* @return 角色数据权限信息列表 [{code: 'ADMIN', data_scope: 1}, ...]
|
||||
*/
|
||||
List<Map<String, Object>> getRoleDataScopeList(@Param("roleCodes") Set<String> roleCodes);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user