| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class PermsService implements PermsMapper { |
| | | @Autowired |
| | | @Resource |
| | | PermsMapper permsMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | RedisService redisService; |
| | | |
| | | @Override |
| | |
| | | return permsMapper.selectMenuRecursive(id, uid); |
| | | } |
| | | |
| | | public void clearResCache() { |
| | | redisService.clearKeys(RedisCacheKey.permsResKey("")); |
| | | } |
| | | |
| | | /** |
| | | * 清除授权缓存 |
| | | */ |
| | | public void clearPermsCache() { |
| | | redisService.clearKeys(RedisCacheKey.permsMenusKey("")); |
| | | redisService.clearKeys(RedisCacheKey.permsPermsKey("")); |
| | | redisService.clearKeys(RedisCacheKey.permsPermsEntityKey("")); |
| | | redisService.clearKeys(RedisCacheKey.permsRootKey()); |
| | | } |
| | | |
| | | /** |
| | | * 清除所有缓存 |
| | | */ |
| | | public void clearAllCache() { |
| | | redisService.clearKeys(RedisCacheKey.permsRootKey()); |
| | | redisService.clearAll(); |
| | | } |
| | | } |