AppRegister
This commit is contained in:
@ -229,6 +229,7 @@ public class RedisUtils {
|
||||
* @return 值
|
||||
*/
|
||||
public <T> T get(String key, Class<T> clazz) {
|
||||
System.out.println("get:------------------------"+ key);
|
||||
Object value = key == null ? null : redisTemplate.opsForValue().get(key);
|
||||
if (value == null) {
|
||||
return null;
|
||||
@ -324,6 +325,8 @@ public class RedisUtils {
|
||||
* @return true成功 false 失败
|
||||
*/
|
||||
public boolean set(String key, Object value, long time) {
|
||||
System.out.println("set:------------------------"+ key);
|
||||
|
||||
try {
|
||||
if (time > 0) {
|
||||
redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
|
||||
|
Reference in New Issue
Block a user