管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-01 870e42b9961f184f9fdfafb0fb18b15640b3813d
src/main/java/com/lf/server/service/all/PermsService.java
@@ -6,6 +6,7 @@
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;
@@ -15,10 +16,10 @@
 */
@Service
public class PermsService implements PermsMapper {
    @Autowired
    @Resource
    PermsMapper permsMapper;
    @Autowired
    @Resource
    RedisService redisService;
    @Override
@@ -95,17 +96,17 @@
        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();
    }
}