月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-09-08 04e25c370a797a61aefb86daad4dab3854d0db82
src/main/java/com/moon/server/service/all/PermsService.java
@@ -4,9 +4,9 @@
import com.moon.server.entity.sys.MenuEntity;
import com.moon.server.entity.sys.ResEntity;
import com.moon.server.mapper.all.PermsMapper;
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;
@@ -16,10 +16,10 @@
 */
@Service
public class PermsService implements PermsMapper {
    @Autowired
    @Resource
    PermsMapper permsMapper;
    @Autowired
    @Resource
    RedisService redisService;
    @Override
@@ -36,6 +36,11 @@
        }
        return list;
    }
    @Override
    public List<ResEntity> selectAllRes() {
        return permsMapper.selectAllRes();
    }
    @Override
@@ -96,15 +101,30 @@
        return permsMapper.selectMenuRecursive(id, uid);
    }
    /**
     * 清除资源缓存
     */
    public void clearResCache() {
        redisService.clearKeys(RedisCacheKey.permsResKey(""));
        redisService.clearKeys(RedisCacheKey.permsResListKey(""));
    }
    /**
     * 清除图层缓存
     */
    public void clearLayerCache() {
        redisService.clearKeys(RedisCacheKey.permsLayerKey(""));
    }
    /**
     * 清除授权缓存
     */
    public void clearPermsCache() {
        redisService.clearKeys(RedisCacheKey.permsRootKey());
    }
    /**
     * 清除所有缓存
     */
    public void clearAllCache() {
        redisService.clearAll();
    }