mirror of
https://gitee.com/y_project/RuoYi-Vue.git
synced 2026-08-17 17:49:40 +08:00
升级spring-boot到最新版本4.1.0
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.common.core.redis;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -46,7 +47,7 @@ public class RedisCache
|
||||
*/
|
||||
public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit)
|
||||
{
|
||||
redisTemplate.opsForValue().set(key, value, timeout, timeUnit);
|
||||
redisTemplate.opsForValue().set(key, value, Duration.of(timeout, timeUnit.toChronoUnit()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,7 +72,7 @@ public class RedisCache
|
||||
*/
|
||||
public boolean expire(final String key, final long timeout, final TimeUnit unit)
|
||||
{
|
||||
return redisTemplate.expire(key, timeout, unit);
|
||||
return redisTemplate.expire(key, Duration.of(timeout, unit.toChronoUnit()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user