@bropen.toolkit.annotation.DomainEquals(compareMap = true, includes = "user, code") class UserProfile extends Object
用户个性设置
def user = ctx.secUserService.currentUser
// 创建/更新个性设置,并从数据库中读取
UserProfile.createOrUpdate(user, "test", "test111")
assert UserProfile.ofUser(user, "test") == "test111"
// 创建/更新个性设置,并从当前 session 中读取
UserProfile.createOrUpdate(user, "test", "test222", null, session)
assert UserProfile.ofUser(session, "test") == "test222"
assert UserProfile.ofUser(user, "test") == "test222"
| Type | Name and description |
|---|---|
static void |
createOrUpdate(User user, String code, String value, List<UserProfile> allProfiles = null, javax.servlet.http.HttpSession session = null)创建或更新用户的个性配置 |
static void |
disableTabs(Collection<String> tabNames, Domain domain = null, DomainApplication application = null)禁用个性设置功能中的页签 |
static void |
enableTabs(Collection<String> tabNames, Domain domain = null, DomainApplication application = null)启用个性设置功能中的页签 |
static Map<String, String> |
ofUser(User user)从数据库中获得用户的所有个性配置 |
static String |
ofUser(User user, String code)从数据库中获得用户的个性配置 |
static Map<String, String> |
ofUser(Long userId)从数据库中获得用户的所有个性配置 |
static String |
ofUser(Long userId, String code)从数据库中获得用户的个性配置 |
static Map<String, String> |
ofUser(javax.servlet.http.HttpSession session)从用户 session 中获得用户的所有个性配置 |
static String |
ofUser(javax.servlet.http.HttpSession session, String code)从用户 session 中获得用户的个性配置 |
String |
toString() |
| Methods inherited from class | Name |
|---|---|
class Object |
Object#wait(long, int), Object#wait(long), Object#wait(), Object#equals(Object), Object#toString(), Object#hashCode(), Object#getClass(), Object#notify(), Object#notifyAll() |
键
用户
值
创建或更新用户的个性配置
allProfiles - 用户的所有个性配置,当循环更新多个配置时,可以提前通过 UserProfile.findAllByUser(user) 获取并传进来以提升性能,否则保持默认即可。session - 如果不为空,则更新后缓存到 session 中;如果为空,则无法通过 session 获得更新后的配置。禁用个性设置功能中的页签
需配合各 _editProfile_Xxxx.gsp。
启用个性设置功能中的页签
需配合各 _editProfile_Xxxx.gsp。
从数据库中获得用户的所有个性配置
从数据库中获得用户的个性配置
从数据库中获得用户的所有个性配置
从数据库中获得用户的个性配置
从用户 session 中获得用户的所有个性配置
从用户 session 中获得用户的个性配置