|
@@ -1,6 +1,7 @@
|
|
|
package org.hswebframework.web.service.authorization.simple;
|
|
|
|
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
|
+import org.hswebframework.web.service.authorization.*;
|
|
|
import org.hswebframework.web.commons.entity.DataStatus;
|
|
|
import org.hswebframework.web.commons.entity.GenericEntity;
|
|
|
import org.hswebframework.web.dao.authorization.RoleDao;
|
|
@@ -13,8 +14,6 @@ import org.hswebframework.web.entity.authorization.bind.BindRoleUserEntity;
|
|
|
import org.hswebframework.web.id.IDGenerator;
|
|
|
import org.hswebframework.web.service.AbstractService;
|
|
|
import org.hswebframework.web.service.DefaultDSLQueryService;
|
|
|
-import org.hswebframework.web.service.DefaultDSLUpdateService;
|
|
|
-import org.hswebframework.web.service.authorization.*;
|
|
|
import org.hswebframework.web.service.authorization.events.UserModifiedEvent;
|
|
|
import org.hswebframework.web.validate.ValidationException;
|
|
|
import org.hswebframework.utils.ListUtils;
|
|
@@ -32,8 +31,6 @@ import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static org.hswebframework.web.service.DefaultDSLUpdateService.*;
|
|
|
-import static org.hswebframework.web.service.authorization.simple.CacheConstants.USER_AUTH_CACHE_NAME;
|
|
|
-import static org.hswebframework.web.service.authorization.simple.CacheConstants.USER_CACHE_NAME;
|
|
|
|
|
|
/**
|
|
|
* 默认的用户服务实现
|
|
@@ -127,7 +124,7 @@ public class SimpleUserService extends AbstractService<UserEntity, String>
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @CacheEvict(value = USER_CACHE_NAME, key = "#userEntity.id")
|
|
|
+ @CacheEvict(value = CacheConstants.USER_CACHE_NAME, key = "#userEntity.id")
|
|
|
public String insert(UserEntity userEntity) {
|
|
|
//用户名合法性验证
|
|
|
tryValidateProperty(usernameValidator, UserEntity.username, userEntity.getUsername());
|
|
@@ -168,10 +165,10 @@ public class SimpleUserService extends AbstractService<UserEntity, String>
|
|
|
|
|
|
@Override
|
|
|
@Caching(evict = {
|
|
|
- @CacheEvict(value = USER_CACHE_NAME, key = "#userId"),
|
|
|
- @CacheEvict(value = USER_AUTH_CACHE_NAME, key = "#userId"),
|
|
|
- @CacheEvict(value = USER_AUTH_CACHE_NAME, key = "'user-menu-list:'+#userId"),
|
|
|
- @CacheEvict(value = USER_AUTH_CACHE_NAME, key = "'menu-tree:'+#userId")
|
|
|
+ @CacheEvict(value = CacheConstants.USER_CACHE_NAME, key = "#userId"),
|
|
|
+ @CacheEvict(value = CacheConstants.USER_AUTH_CACHE_NAME, key = "#userId"),
|
|
|
+ @CacheEvict(value = CacheConstants.USER_AUTH_CACHE_NAME, key = "'user-menu-list:'+#userId"),
|
|
|
+ @CacheEvict(value = CacheConstants.USER_AUTH_CACHE_NAME, key = "'menu-tree:'+#userId")
|
|
|
})
|
|
|
public void update(String userId, UserEntity userEntity) {
|
|
|
userEntity.setId(userId);
|