@Component public class UserCache extends Object
| 构造器和说明 |
|---|
UserCache() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
清空用户缓存
|
String |
getLoginName(Long userId)
根据用户ID获取登录名称
|
String |
getNickname(Long userId)
根据用户ID,获取用户姓名
|
Integer |
getPowerType(Long userId) |
Long |
getTenantId(Long userId)
根据用户ID获取用户当前所在租户ID
|
Map<String,Object> |
getUser(long userId)
获取简短用户信息列表
|
String |
getUserAvatar(Long userId)
根据用户ID,获取用户头像
|
Map<String,Object> |
getUserMap(Long userId)
根据用户ID获取用户详情
|
String |
getUserName(Long userId)
根据用户ID,获取用户姓名
|
String |
getUserNo(Long userId)
根据用户ID,获取用户编号
|
List<Map<String,Object>> |
getUsers(List<Long> users) |
boolean |
isAdministrator(Long userId)
是否为管理员
|
boolean |
isDeveloper(Long userId)
是否为开发人员
|
boolean |
isLoginEnabled(Long userId)
是否启用帐户
0 禁用,1启动
|
List<Map<String,Object>> |
list()
获取所有用户列表
|
void |
reload()
启动,初始化到缓存
|
void |
reload(Object userId)
根据用户id初始化到缓存中
|
void |
remove(Object userId)
根据用户ID清空用户缓存
|
@Comment(value="\u83b7\u53d6\u6240\u6709\u7528\u6237\u5217\u8868") public List<Map<String,Object>> list() throws SQLException
SQLException@Comment(value="\u83b7\u53d6\u7528\u6237\u4fe1\u606f") public Map<String,Object> getUser(long userId) throws SQLException
SQLExceptionpublic List<Map<String,Object>> getUsers(List<Long> users) throws SQLException
users - SQLException@Comment(value="\u542f\u52a8\uff0c\u521d\u59cb\u5316\u5230\u7f13\u5b58")
public void reload()
throws SQLException
SQLException@Comment(value="\u6839\u636e\u7528\u6237id\u521d\u59cb\u5316\u5230\u7f13\u5b58\u4e2d") public void reload(Object userId) throws SQLException
userId - 用户IDSQLException@Comment(value="\u83b7\u53d6\u7528\u6237\u59d3\u540d") public String getNickname(Long userId) throws SQLException
userId - 用户IDSQLException@Comment(value="\u83b7\u53d6\u7528\u6237\u6743\u9650\u7c7b\u578b") public Integer getPowerType(Long userId) throws SQLException
userId - SQLException@Comment(value="\u83b7\u53d6\u7528\u6237\u59d3\u540d") public String getUserName(Long userId) throws SQLException
userId - 用户IDSQLException@Comment(value="\u83b7\u53d6\u7528\u6237\u5934\u50cf") public String getUserAvatar(Long userId) throws SQLException
userId - SQLException@Comment(value="\u83b7\u53d6\u7528\u6237\u7f16\u53f7") public String getUserNo(Long userId) throws SQLException
userId - 用户IDSQLException@Comment(value="\u6839\u636e\u7528\u6237ID\u83b7\u53d6\u767b\u5f55\u540d\u79f0") public String getLoginName(Long userId) throws SQLException
userId - 用户IDSQLException@Comment(value="\u6839\u636e\u7528\u6237ID\u83b7\u53d6\u7528\u6237\u8be6\u60c5") public Map<String,Object> getUserMap(Long userId) throws SQLException
userId - 用户IDSQLException@Comment(value="\u662f\u5426\u4e3a\u5f00\u53d1\u4eba\u5458") public boolean isDeveloper(Long userId) throws SQLException
userId - SQLException@Comment(value="\u662f\u5426\u4e3a\u7ba1\u7406\u5458") public boolean isAdministrator(Long userId) throws SQLException
SQLException@Comment(value="\u662f\u5426\u542f\u7528\u5e10\u6237") public boolean isLoginEnabled(Long userId) throws SQLException
SQLException@Comment(value="\u6839\u636e\u7528\u6237ID\u83b7\u53d6\u7528\u6237\u5f53\u524d\u6240\u5728\u79df\u6237ID") public Long getTenantId(Long userId) throws SQLException
userId - 用户IDSQLException@Comment(value="\u6e05\u7a7a\u7528\u6237\u7f13\u5b58") public void clear()
@Comment(value="\u6839\u636e\u7528\u6237ID\u6e05\u7a7a\u7528\u6237\u7f13\u5b58") public void remove(Object userId)
userId - 用户IDCopyright © 2025. All rights reserved.