@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
SQLException
public List<Map<String,Object>> listSimpleUser(Long tenantId) throws SQLException
tenantId
- 租户IDSQLException
public void reload() throws SQLException
SQLException
public void reload(Object userId) throws SQLException
userId
- 用户IDSQLException
public String getUserName(Long userId) throws SQLException
userId
- 用户IDSQLException
public String getUserNo(Long userId) throws SQLException
userId
- 用户IDSQLException
public String getLoginName(Long userId) throws SQLException
userId
- 用户IDSQLException
public Map<String,Object> getUserMap(Long userId) throws SQLException
userId
- 用户IDSQLException
public boolean isDeveloper(Long userId) throws SQLException
userId
- SQLException
public boolean isAdministrator(Long userId) throws SQLException
SQLException
public boolean isLoginEnabled(Long userId) throws SQLException
SQLException
public Long getTenantId(Long userId) throws SQLException
userId
- 用户IDSQLException
public void clear()
public void remove(Object userId)
userId
- 用户IDCopyright © 2025. All rights reserved.