| | |
| | | public Map<String, Object> getLocMapData(Integer row) { |
| | | String cacheDataKey = LOC_MAP_CACHE_KEY_PREFIX + row; |
| | | if (redisUtil != null) { |
| | | try { |
| | | Object redisData = redisUtil.get(cacheDataKey); |
| | | if (redisData instanceof Map) { |
| | | return (Map<String, Object>) redisData; |
| | | } |
| | | } catch (Exception e) { |
| | | log.warn("Redis读缓存失败,改查数据库,key={}", cacheDataKey, e); |
| | | } |
| | | } |
| | | |
| | |
| | | result.put("title", bays); |
| | | result.put("body", body); |
| | | if (redisUtil != null) { |
| | | try { |
| | | redisUtil.set(cacheDataKey, result, LOC_MAP_CACHE_SECONDS); |
| | | } catch (Exception e) { |
| | | log.warn("Redis写缓存失败,key={}", cacheDataKey, e); |
| | | } |
| | | } |
| | | return result; |
| | | } |