cache.md 835 B

 @Override
    public PageBean<Map<String, Object>> query(Map<String, Object> map) {
        JSONObject params = new JSONObject(map);
        ICache cache = Caches.getCache(CacheConfig.OL_CACHE);
        String key = Caches.generatorKey(cache, params);
        PageBean<Map<String, Object>> list = CacheUtils.get(cache, key, true, () -> {
            LogKit.me.log("create--------------" + key);
            PageHelper.startPage(params.getInteger("page"), params.getInteger("limit"));
            return new PageBean<>(olQuestionsMapper.queryBYPage(map));
        });
        if (list == null || list.getList().isEmpty()) {
            PageHelper.startPage(params.getInteger("page"), params.getInteger("limit"));
            return new PageBean<>(olQuestionsMapper.queryBYPage(map));
        }
        return list;
    }