@Component public class RoleCache extends Object
| 构造器和说明 |
|---|
RoleCache() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
清除整个岗位缓存的内容。
|
Map<String,Object> |
getRole(Long roleId)
根据岗位ID获取单个岗位的信息。
|
String |
getRoleName(Object roleId)
根据岗位ID获取岗位名称。
|
List<Map<String,Object>> |
getRoles(List<Long> roles)
批量获取多个岗位的信息列表。
|
void |
reload()
全量刷新岗位缓存数据。
|
void |
reload(Object roleId)
按指定岗位ID增量刷新缓存中的对应条目。
|
void |
remove(Object roleId)
移除特定岗位ID在缓存中的条目。
|
@Comment(value="\u542f\u52a8\uff0c\u52a0\u8f7d\u5c97\u4f4d\u5230\u7f13\u5b58")
public void reload()
throws SQLException
SQLException - 当执行SQL语句时发生错误会抛出该异常@Comment(value="\u6839\u636e\u5c97\u4f4dID,\u91cd\u65b0\u52a0\u8f7d\u5230\u7f13\u5b58")
public void reload(@Comment(value="\u5c97\u4f4dID")
Object roleId)
throws SQLException
roleId - 要刷新的岗位IDSQLException - 当执行SQL语句时发生错误会抛出该异常public Map<String,Object> getRole(Long roleId)
roleId - 岗位IDpublic List<Map<String,Object>> getRoles(List<Long> roles)
roles - 岗位ID列表@Comment(value="\u83b7\u53d6\u5c97\u4f4d\u540d\u79f0") public String getRoleName(@Comment(value="\u5c97\u4f4dID") Object roleId) throws SQLException
roleId - 岗位IDSQLException - 当执行SQL语句时发生错误会抛出该异常@Comment(value="\u6e05\u7a7a\u7f13\u5b58") public void clear()
@Comment(value="\u6e05\u7a7a\u5c97\u4f4d\u7f13\u5b58")
public void remove(@Comment(value="\u5c97\u4f4dID")
Object roleId)
roleId - 待删除的岗位IDCopyright © 2026. All rights reserved.