@Component public class UserCache extends Object
| 构造器和说明 |
|---|
UserCache() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
清空用户缓存
|
String |
getLoginName(Long userId)
根据用户ID获取登录名称
|
Long |
getTenantId(Long userId)
根据用户ID获取用户当前所在租户ID
|
Map<String,Object> |
getUserMap(Long userId)
根据用户ID获取用户详情
|
String |
getUserName(Long userId)
根据用户ID,获取用户姓名
|
String |
getUserNo(Long userId)
根据用户ID,获取用户编号
|
boolean |
isAdministrator(Long userId)
是否为管理员
|
boolean |
isDeveloper(Long userId)
是否为开发人员
|
boolean |
isLoginEnabled(Long userId)
是否启用帐户
0 禁用,1启动
|
List<Map<String,Object>> |
list()
获取所有用户列表
|
List<Map<String,Object>> |
listSimpleUser(Long tenantId)
获取简短用户信息列表
|
void |
reload()
启动,初始化到缓存
|
void |
reload(Object userId)
根据用户id初始化到缓存中
|
void |
remove(Object userId)
根据用户ID清空用户缓存
|
public List<Map<String,Object>> list() throws SQLException
SQLExceptionpublic List<Map<String,Object>> listSimpleUser(Long tenantId) throws SQLException
tenantId - 租户IDSQLExceptionpublic void reload()
throws SQLException
SQLExceptionpublic void reload(Object userId) throws SQLException
userId - 用户IDSQLExceptionpublic String getUserName(Long userId) throws SQLException
userId - 用户IDSQLExceptionpublic String getUserNo(Long userId) throws SQLException
userId - 用户IDSQLExceptionpublic String getLoginName(Long userId) throws SQLException
userId - 用户IDSQLExceptionpublic Map<String,Object> getUserMap(Long userId) throws SQLException
userId - 用户IDSQLExceptionpublic boolean isDeveloper(Long userId) throws SQLException
userId - SQLExceptionpublic boolean isAdministrator(Long userId) throws SQLException
SQLExceptionpublic boolean isLoginEnabled(Long userId) throws SQLException
SQLExceptionpublic Long getTenantId(Long userId) throws SQLException
userId - 用户IDSQLExceptionpublic void clear()
public void remove(Object userId)
userId - 用户IDCopyright © 2025. All rights reserved.