Browse Source

统一管理key

master
gjh 3 months ago
parent
commit
ebcc75882d
  1. 4
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

4
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

@ -2705,7 +2705,7 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
public List<HuzhouProjectinfo> queryBoardInfo() {
// 记录开始时间
long startTime = System.currentTimeMillis();
String redisKey = "hz_project_board_info";
String redisKey = CommonConstant.REDIS_KEY_PROJECT_BOARD_INFO;
// 如果存在缓存数据,则直接返回缓存数据
String cacheData = stringRedisTemplate.opsForValue().get(redisKey);
log.info("***查询晾晒看板,缓存键:{}", redisKey);
@ -2776,7 +2776,7 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
.collect(Collectors.toList());
stringRedisTemplate.opsForValue().set(redisKey, JSON.toJSONString(projectInfoList));
stringRedisTemplate.expire(redisKey, 60*6, TimeUnit.MINUTES);
stringRedisTemplate.expire(redisKey, CommonConstant.REDIS_EXPIRE_TIME, TimeUnit.MINUTES);
// 记录结束时间并计算耗时
long endTime = System.currentTimeMillis();

Loading…
Cancel
Save