缓存查询用户权限方法

This commit is contained in:
shuzheng 2017-05-30 23:51:21 +08:00
parent af0b0059ca
commit a0d62e4a77
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import com.zheng.upms.rpc.mapper.UpmsApiMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -49,6 +50,7 @@ public class UpmsApiServiceImpl implements UpmsApiService {
* @return
*/
@Override
@Cacheable(value = "zheng-upms-rpc-service-ehcache", key = "'selectUpmsPermissionByUpmsUserId_' + #upmsUserId")
public List<UpmsPermission> selectUpmsPermissionByUpmsUserId(Integer upmsUserId) {
// 用户不存在或锁定状态
UpmsUser upmsUser = upmsUserMapper.selectByPrimaryKey(upmsUserId);
@ -66,6 +68,7 @@ public class UpmsApiServiceImpl implements UpmsApiService {
* @return
*/
@Override
@Cacheable(value = "zheng-upms-rpc-service-ehcache", key = "'selectUpmsRoleByUpmsUserId_' + #upmsUserId")
public List<UpmsRole> selectUpmsRoleByUpmsUserId(Integer upmsUserId) {
// 用户不存在或锁定状态
UpmsUser upmsUser = upmsUserMapper.selectByPrimaryKey(upmsUserId);